update examples
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
[app]
|
|
||||||
|
|
||||||
name = "advanced"
|
|
||||||
version = "0.0.1"
|
|
||||||
authors = ["vx-clutch"]
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
local foo = {}
|
|
||||||
|
|
||||||
foo.render = function()
|
|
||||||
return "This was called from a foo function"
|
|
||||||
end
|
|
||||||
|
|
||||||
return foo
|
|
||||||
@@ -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
|
|
||||||
4
examples/archive/README.md
Normal file
4
examples/archive/README.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# archive
|
||||||
|
|
||||||
|
This example demonstrates the archive feature of Fes it is useful for file
|
||||||
|
sharing purposes.
|
||||||
|
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 1.8 MiB |
@@ -1,17 +1,10 @@
|
|||||||
local fes = require("fes")
|
local fes = require("fes")
|
||||||
local std = fes.std
|
|
||||||
|
|
||||||
local site = fes.fes()
|
local site = fes.fes()
|
||||||
|
|
||||||
site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD")
|
site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD")
|
||||||
|
|
||||||
site:h1("Hello, World!")
|
site:h1("Hello, World!")
|
||||||
|
|
||||||
site:note(fes.util.cc {
|
site:a("/archive", fes.std.h2("To the file room!"))
|
||||||
std.h2("Files"),
|
|
||||||
std.ul {
|
|
||||||
std.a("/archive", "to the file room!"),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return site
|
return site
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[app]
|
[app]
|
||||||
|
|
||||||
name = "hello"
|
name = "best"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
authors = ["vx-clutch"]
|
authors = ["vx-clutch"]
|
||||||
23
examples/best/README.md
Normal file
23
examples/best/README.md
Normal file
@@ -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.
|
||||||
13
examples/best/include/footer.lua
Normal file
13
examples/best/include/footer.lua
Normal file
@@ -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
|
||||||
7
examples/best/include/header.lua
Normal file
7
examples/best/include/header.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
local header = {}
|
||||||
|
|
||||||
|
header.render = function(std)
|
||||||
|
return std.center(std.ha("/", std.h1("Best Practices")))
|
||||||
|
end
|
||||||
|
|
||||||
|
return header
|
||||||
BIN
examples/best/static/favicon.ico
Normal file
BIN
examples/best/static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
20
examples/best/www/index.lua
Normal file
20
examples/best/www/index.lua
Normal file
@@ -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
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
local fes = require("fes")
|
local fes = require("fes")
|
||||||
local site = fes.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!")
|
site:h1("Hello, World!")
|
||||||
|
|
||||||
|
|||||||
6
examples/error/README.md
Normal file
6
examples/error/README.md
Normal file
@@ -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.
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
local fes = require("fes")
|
local fes = require("fes")
|
||||||
local site = fes.fes()
|
local site = fes.fes()
|
||||||
|
|
||||||
|
site.copyright = fes.util.copyright("https://fsd.vxserver.dev", "fSD")
|
||||||
|
|
||||||
This is what an error looks like
|
This is what an error looks like
|
||||||
|
|
||||||
|
site:h1("Hello, World!")
|
||||||
|
|
||||||
return site
|
return site
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
services:
|
|
||||||
hello:
|
|
||||||
image: git.vxserver.dev/fsd/fes:latest
|
|
||||||
ports:
|
|
||||||
- "3000:3000"
|
|
||||||
volumes:
|
|
||||||
- ./app:/app
|
|
||||||
4
examples/hello/README.md
Normal file
4
examples/hello/README.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# hello
|
||||||
|
|
||||||
|
This is a very simple hello world program, the only difference between this and
|
||||||
|
default is this README.
|
||||||
3
examples/markdown/README.md
Normal file
3
examples/markdown/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# markdown
|
||||||
|
|
||||||
|
This example demonstrate Fes's ability to handle markdown routes.
|
||||||
@@ -1 +1,3 @@
|
|||||||
# Hello, World!
|
# Markdown!
|
||||||
|
|
||||||
|
**Fes** also supports markdown routes!
|
||||||
|
|||||||
5
examples/simple/README.md
Normal file
5
examples/simple/README.md
Normal file
@@ -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.
|
||||||
Reference in New Issue
Block a user