fes

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 1c229f1b3e0e4c160292360807879ba97ce73a3e
parent 5a733b864236485ef2296373408cd593a95d5571
Author: vx-clutch <[email protected]>
Date:   Sun, 28 Dec 2025 20:17:46 -0500

update examples

Diffstat:
Dexamples/advanced/Fes.toml | 6------
Dexamples/advanced/include/foo.lua | 7-------
Dexamples/advanced/www/index.lua | 15---------------
Aexamples/archive/README.md | 4++++
Rexamples/archive/archive/2025.12.07/seal.png -> examples/archive/archive/seal.png | 0
Mexamples/archive/www/index.lua | 9+--------
Aexamples/best/Fes.toml | 6++++++
Aexamples/best/README.md | 23+++++++++++++++++++++++
Aexamples/best/include/footer.lua | 13+++++++++++++
Aexamples/best/include/header.lua | 7+++++++
Aexamples/best/static/favicon.ico | 0
Aexamples/best/www/index.lua | 20++++++++++++++++++++
Mexamples/default/www/index.lua | 5++---
Aexamples/error/README.md | 6++++++
Mexamples/error/www/index.lua | 4++++
Dexamples/hello-with-docker/app/Fes.toml | 6------
Dexamples/hello-with-docker/app/www/index.lua | 8--------
Dexamples/hello-with-docker/docker-compose.yml | 7-------
Aexamples/hello/README.md | 4++++
Aexamples/markdown/README.md | 3+++
Mexamples/markdown/www/index.md | 4+++-
Aexamples/simple/README.md | 5+++++
22 files changed, 101 insertions(+), 61 deletions(-)

diff --git a/examples/advanced/Fes.toml b/examples/advanced/Fes.toml @@ -1,5 +0,0 @@ -[app] - -name = "advanced" -version = "0.0.1" -authors = ["vx-clutch"] -\ No newline at end of file diff --git a/examples/advanced/include/foo.lua b/examples/advanced/include/foo.lua @@ -1,7 +0,0 @@ -local foo = {} - -foo.render = function() - return "This was called from a foo function" -end - -return foo diff --git a/examples/advanced/www/index.lua b/examples/advanced/www/index.lua @@ -1,15 +0,0 @@ -local fes = require("fes") -local std = fes.std - - -local site = fes.fes() - -site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD") - -site:h1("Hello, World!") - -site:note( - fes.app.foo.render() -) - -return site diff --git a/examples/archive/README.md b/examples/archive/README.md @@ -0,0 +1,4 @@ +# archive + +This example demonstrates the archive feature of Fes it is useful for file +sharing purposes. diff --git a/examples/archive/archive/2025.12.07/seal.png b/examples/archive/archive/seal.png Binary files differ. diff --git a/examples/archive/www/index.lua b/examples/archive/www/index.lua @@ -1,17 +1,10 @@ local fes = require("fes") -local std = fes.std - local site = fes.fes() site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD") site:h1("Hello, World!") -site:note(fes.util.cc { - std.h2("Files"), - std.ul { - std.a("/archive", "to the file room!"), - } -}) +site:a("/archive", fes.std.h2("To the file room!")) return site diff --git a/examples/best/Fes.toml b/examples/best/Fes.toml @@ -0,0 +1,5 @@ +[app] + +name = "best" +version = "0.0.1" +authors = ["vx-clutch"] +\ No newline at end of file diff --git a/examples/best/README.md b/examples/best/README.md @@ -0,0 +1,23 @@ +# best + +This is an example of best practices for the Fes framework. + +## Parts + +With best practice we can break our sites into a few parts. + +## Index + +The main page of the site loads in the header and the footer, as well as shows +some core information + +## Include + +Within include the header and footer are defined. + +* **Header:** Site navigation and name display +* **Footer:** Extra and external information. + +## Static + +This is where we store our favicon. diff --git a/examples/best/include/footer.lua b/examples/best/include/footer.lua @@ -0,0 +1,13 @@ +local footer = {} + +footer.render = function(std) + return table.concat({ + std.h2("Other resources"), + std.tl({ + std.external("https://git.vxserver.dev/fSD/fes", "Fes source"), + std.external("https://docs.vxserver.dev/static/fes.html", "Documentation"), + }), +}) +end + +return footer diff --git a/examples/best/include/header.lua b/examples/best/include/header.lua @@ -0,0 +1,7 @@ +local header = {} + +header.render = function(std) + return std.center(std.ha("/", std.h1("Best Practices"))) +end + +return header diff --git a/examples/best/static/favicon.ico b/examples/best/static/favicon.ico Binary files differ. diff --git a/examples/best/www/index.lua b/examples/best/www/index.lua @@ -0,0 +1,20 @@ +local fes = require("fes") +local std = fes.std +local u = fes.util + +local site = fes.fes() + +site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD") +site.title = "Best practices" +site.favicon = "/static/favicon.ico" + +site:banner(fes.app.header.render(std)) + +site:note(u.cc { + std.h2("Hello, World!"), + std.p("This is an example of the best practices/canonical Fes site.") +}) + +site:note(fes.app.footer.render(std)) + +return site diff --git a/examples/default/www/index.lua b/examples/default/www/index.lua @@ -1,8 +1,8 @@ local fes = require("fes") local site = fes.fes() --- site.copyright = fes.util.copyright("https://example.com", "vx-clutch") +site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD") site:h1("Hello, World!") -return site -\ No newline at end of file +return site diff --git a/examples/error/README.md b/examples/error/README.md @@ -0,0 +1,6 @@ +# error + +This shows what a Lua error looks like to the user. Lua errors are the most +common and the most critical so that is why they are shown to the user. Other, +lesser errors, are only shown to the developer because of their different +nature. diff --git a/examples/error/www/index.lua b/examples/error/www/index.lua @@ -1,6 +1,10 @@ local fes = require("fes") local site = fes.fes() +site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD") + This is what an error looks like +site:h1("Hello, World!") + return site diff --git a/examples/hello-with-docker/app/Fes.toml b/examples/hello-with-docker/app/Fes.toml @@ -1,5 +0,0 @@ -[app] - -name = "hello" -version = "0.0.1" -authors = ["vx-clutch"] -\ No newline at end of file diff --git a/examples/hello-with-docker/app/www/index.lua b/examples/hello-with-docker/app/www/index.lua @@ -1,8 +0,0 @@ -local fes = require("fes") -local site = fes.fes() - -site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD") - -site:h1("Hello, World!") - -return site diff --git a/examples/hello-with-docker/docker-compose.yml b/examples/hello-with-docker/docker-compose.yml @@ -1,7 +0,0 @@ -services: - hello: - image: git.vxserver.dev/fsd/fes:latest - ports: - - "3000:3000" - volumes: - - ./app:/app diff --git a/examples/hello/README.md b/examples/hello/README.md @@ -0,0 +1,4 @@ +# hello + +This is a very simple hello world program, the only difference between this and +default is this README. diff --git a/examples/markdown/README.md b/examples/markdown/README.md @@ -0,0 +1,3 @@ +# markdown + +This example demonstrate Fes's ability to handle markdown routes. diff --git a/examples/markdown/www/index.md b/examples/markdown/www/index.md @@ -1 +1,3 @@ -# Hello, World! +# Markdown! + +**Fes** also supports markdown routes! diff --git a/examples/simple/README.md b/examples/simple/README.md @@ -0,0 +1,5 @@ +# simple + +This simple example shows the extensibility of the Fes framework. It shows the +you do not necessarily need to use the site object (although it is recommended) +you can define your own site, similar to how Lisps do things.