diff --git a/fsd.vxserver.dev/archive/releases/yait/2025-12-07/yait b/fsd.vxserver.dev/archive/releases/yait/2025-12-07/yait new file mode 100755 index 0000000..d852f96 Binary files /dev/null and b/fsd.vxserver.dev/archive/releases/yait/2025-12-07/yait differ diff --git a/fsd.vxserver.dev/archive/releases/yait/yait b/fsd.vxserver.dev/archive/releases/yait/yait new file mode 160000 index 0000000..54db089 --- /dev/null +++ b/fsd.vxserver.dev/archive/releases/yait/yait @@ -0,0 +1 @@ +Subproject commit 54db089b71fc154b340191c1261792611b93eaee diff --git a/fsd.vxserver.dev/archive/releases/yait/yait-2025-12-07.tar.gz b/fsd.vxserver.dev/archive/releases/yait/yait-2025-12-07.tar.gz new file mode 100644 index 0000000..c9b7727 Binary files /dev/null and b/fsd.vxserver.dev/archive/releases/yait/yait-2025-12-07.tar.gz differ diff --git a/fsd.vxserver.dev/static/data b/fsd.vxserver.dev/static/data new file mode 100644 index 0000000..e8313b3 --- /dev/null +++ b/fsd.vxserver.dev/static/data @@ -0,0 +1 @@ +djasjkdjaslkdjaskl diff --git a/fsd.vxserver.dev/image/favicon.ico b/fsd.vxserver.dev/static/image/favicon.ico similarity index 100% rename from fsd.vxserver.dev/image/favicon.ico rename to fsd.vxserver.dev/static/image/favicon.ico diff --git a/fsd.vxserver.dev/www/index.lua b/fsd.vxserver.dev/www/index.lua index 9d249d9..26332ef 100644 --- a/fsd.vxserver.dev/www/index.lua +++ b/fsd.vxserver.dev/www/index.lua @@ -7,6 +7,7 @@ local site = fes.fes() local title = "Free Software Distributions" site.title = title +site.favicon = "/static/image/favicon.ico" site.copyright = u.copyright("https://git.vxserver.dev/fSD", "fSD") site:banner(fes.app.header.render(std)) diff --git a/fsd.vxserver.dev/www/news.lua b/fsd.vxserver.dev/www/news.lua index b655279..5e585f1 100644 --- a/fsd.vxserver.dev/www/news.lua +++ b/fsd.vxserver.dev/www/news.lua @@ -11,49 +11,49 @@ site.copyright = u.copyright("[https://git.vxserver.dev/fSD](https://git.vxserve site:banner(fes.app.header.render(std)) local function url_encode(s) -if not s then return "" end -s = s:gsub("([^%w%-_.~])", function(c) return string.format("%%%02X", string.byte(c)) end) -return s + if not s then return "" end + s = s:gsub("([^%w%-_.~])", function(c) return string.format("%%%02X", string.byte(c)) end) + return s end local function list_files_in_dir(dir) -local files = {} -local ok, lfs = pcall(require, "lfs") -if ok and lfs then -for name in lfs.dir(dir) do -if name ~= "." and name ~= ".." then -local attr = lfs.attributes(dir .. "/" .. name) -if attr and attr.mode == "file" then -table.insert(files, name) -end -end -end -table.sort(files) -return files -end -local p = io.popen('ls -1 "' .. dir:gsub('"','\"') .. '" 2>/dev/null') -if not p then return files end -for line in p:lines() do -if line ~= "." and line ~= ".." then -local f = dir .. "/" .. line -local fh = io.open(f, "r") -if fh then -fh:close() -table.insert(files, line) -end -end -end -p:close() -table.sort(files) -return files + local files = {} + local ok, lfs = pcall(require, "lfs") + if ok and lfs then + for name in lfs.dir(dir) do + if name ~= "." and name ~= ".." then + local attr = lfs.attributes(dir .. "/" .. name) + if attr and attr.mode == "file" then + table.insert(files, name) + end + end + end + table.sort(files) + return files + end + local p = io.popen('ls -1 "' .. dir:gsub('"', '\"') .. '" 2>/dev/null') + if not p then return files end + for line in p:lines() do + if line ~= "." and line ~= ".." then + local f = dir .. "/" .. line + local fh = io.open(f, "r") + if fh then + fh:close() + table.insert(files, line) + end + end + end + p:close() + table.sort(files) + return files end local function read_file(path) -local f = io.open(path, "r") -if not f then return nil end -local data = f:read("*a") -f:close() -return data + local f = io.open(path, "r") + if not f then return nil end + local data = f:read("*a") + f:close() + return data end local dir = "news" @@ -62,44 +62,48 @@ local files = list_files_in_dir(dir) local params = fes.bus.params or {} local article = params.article if type(article) == "table" then -article = article[1] + article = article[1] end if article then -local candidates = {article, article .. ".txt", article .. ".md", article .. ".html"} -local body -for _, c in ipairs(candidates) do -local p = dir .. "/" .. c -body = read_file(p) -if body then break end -end -site.title = article -if body then -site:custom(fes.markdown_to_html(body)) -else -site:note(u.cc { - std.h1(article), - std.p("article not found"), -}) -end -site:note(fes.app.footer.render(std)) -return site + local candidates = { article, article .. ".txt", article .. ".md", article .. ".html" } + local body + for _, c in ipairs(candidates) do + local p = dir .. "/" .. c + body = read_file(p) + if body then break end + end + site.title = article + if body then + site:custom(fes.markdown_to_html(body)) + else + site:note(u.cc { + std.h1(article), + std.p("article not found"), + }) + end + site:note(fes.app.footer.render(std)) + return site end local articles = {} local n = 0 for _, v in ipairs(files) do -local display = v:gsub("%.[^%.]+$", "") -local link = "/news?article=" .. url_encode(display) -table.insert(articles, std.a(link, display)) -n = n + 1 + local display = v:gsub("%.[^%.]+$", "") + local link = "/news?article=" .. url_encode(display) + table.insert(articles, std.a(link, display)) + n = n + 1 end +table.sort(articles, function (x, y) + return x > y +end) + if n > 0 then -site:h1("Site news") -site:note(std.ul(articles)) + site:h1("Site news") + site:note(std.ul(articles)) else -site:h1("No articles") + site:h1("No articles") end site:note(fes.app.footer.render(std)) diff --git a/fsd.vxserver.dev/www/release.lua b/fsd.vxserver.dev/www/release.lua index 61e11e9..684c27e 100644 --- a/fsd.vxserver.dev/www/release.lua +++ b/fsd.vxserver.dev/www/release.lua @@ -22,7 +22,7 @@ for i, pkg in pairs(pkgs) do std.muted(pkg[2] or "Could not find a description."), std.br(), std.ul({ - std.rl(pkg[1], std.external("https://git.vxserver.dev/fSD/" .. pkg[1], "Download")), + std.rl(pkg[1], std.external("/archive/releases/" .. pkg[1], "Download")), }), })) end