78 lines
1.7 KiB
Lua
78 lines
1.7 KiB
Lua
local fes = require("fes")
|
|
local std = fes.std
|
|
local u = fes.util
|
|
|
|
local site = fes.fes()
|
|
|
|
site.title = "fes - Free Easy Site"
|
|
site.copyright = u.copyright("https://git.vxserver.dev/fSD", "fSD")
|
|
site.favicon = "/static/favicon.ico"
|
|
|
|
site:banner(fes.app.header.render(std))
|
|
|
|
site:h2("Fes")
|
|
site:muted("fes is a lightweight, static, and optionated microframework.")
|
|
|
|
site:h2("Development")
|
|
site:p("You can " ..
|
|
std.external("https://git.vxserver.dev/fSD/fes", "browse") ..
|
|
" its source code or get a copy using the following command:")
|
|
site:code("git clone https://git.vxserver.dev/fSD/fes")
|
|
|
|
site:h2("Docker")
|
|
site:p("You can deploy websites using the " ..
|
|
std.external("https://git.vxserver.dev/fSD/-/packages/container/fes/latest", "docker") .. " image:")
|
|
site:code("docker pull git.vxserver.dev/fsd/fes:latest")
|
|
|
|
local tars = u.ls("archive")
|
|
|
|
local function parseVersion(pkg)
|
|
local version = pkg:match("-(.+)$")
|
|
local parts = {}
|
|
for n in version:gmatch("%d+") do
|
|
parts[#parts + 1] = tonumber(n)
|
|
end
|
|
return parts
|
|
end
|
|
|
|
local function isNewer(a, b)
|
|
local va, vb = parseVersion(a), parseVersion(b)
|
|
local len = math.max(#va, #vb)
|
|
|
|
for i = 1, len do
|
|
local na, nb = va[i] or 0, vb[i] or 0
|
|
if na ~= nb then
|
|
return na > nb
|
|
end
|
|
end
|
|
return false
|
|
end
|
|
|
|
local function latestRelease(packages, name)
|
|
local latest = nil
|
|
local prefix = "^" .. name .. "%-"
|
|
|
|
for _, pkg in ipairs(packages) do
|
|
if pkg:match(prefix) then
|
|
if not latest or isNewer(pkg, latest) then
|
|
latest = pkg
|
|
end
|
|
end
|
|
end
|
|
|
|
return latest
|
|
end
|
|
|
|
local latest = latestRelease(tars, "fes")
|
|
|
|
site:h2("Download")
|
|
site:ul {
|
|
std.p(std.a("/archive/" .. latest, latest) .. " (2026-04-1)"),
|
|
std.a("/archive/fes", "Looking for specific version?")
|
|
}
|
|
|
|
|
|
site:note(fes.app.footer.render(std))
|
|
|
|
return site
|