diff --git a/README.md b/README.md deleted file mode 100644 index 01a4d11..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# site - diff --git a/fsd.vxserver.dev/Fes.toml b/fsd.vxserver.dev/Fes.toml new file mode 100644 index 0000000..77038df --- /dev/null +++ b/fsd.vxserver.dev/Fes.toml @@ -0,0 +1,9 @@ +[site] + +name = "site" +version = "0.0.1" +authors = ["owen"] + +[fes] +version = "1.0.0" +CUSTOM_CSS = diff --git a/fsd.vxserver.dev/article/alpha-release.md b/fsd.vxserver.dev/article/alpha-release.md new file mode 100644 index 0000000..d975231 --- /dev/null +++ b/fsd.vxserver.dev/article/alpha-release.md @@ -0,0 +1,10 @@ +### Site version alpha release + +This is the alpha version of the fSD website, this site +contains many cool and interesting features which I +suggest that you navigate and learn more about. + +If you think that this experience can be improved +send you suggestion or report to . + +2025-28-11 diff --git a/fsd.vxserver.dev/article/holiday-season.md b/fsd.vxserver.dev/article/holiday-season.md new file mode 100644 index 0000000..63eb350 --- /dev/null +++ b/fsd.vxserver.dev/article/holiday-season.md @@ -0,0 +1,3 @@ +### Holiday Season + +Merry Christmas and Happy Holidays! diff --git a/fsd.vxserver.dev/include/favicon.ico b/fsd.vxserver.dev/include/favicon.ico new file mode 100644 index 0000000..4268696 Binary files /dev/null and b/fsd.vxserver.dev/include/favicon.ico differ diff --git a/fsd.vxserver.dev/include/footer.lua b/fsd.vxserver.dev/include/footer.lua new file mode 100644 index 0000000..ebd12ce --- /dev/null +++ b/fsd.vxserver.dev/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", "Git Trees"), + std.external("https://git.vxserver.dev/fSD", "Documentation"), + }), +}) +end + +return footer diff --git a/fsd.vxserver.dev/include/header.lua b/fsd.vxserver.dev/include/header.lua new file mode 100644 index 0000000..2f49c65 --- /dev/null +++ b/fsd.vxserver.dev/include/header.lua @@ -0,0 +1,15 @@ +local header = {} + +header.render = function(std) + return table.concat({ + std.center(std.ha("/", std.h1("Free Software Distributions"))), + std.center(table.concat({ + std.nav("about", "About"), + std.nav("faq", "FAQ"), + std.nav("release", "Releases"), + std.nav("news", "Site news"), + })) + }) +end + +return header diff --git a/fsd.vxserver.dev/include/snippet.lua b/fsd.vxserver.dev/include/snippet.lua new file mode 100644 index 0000000..11c6746 --- /dev/null +++ b/fsd.vxserver.dev/include/snippet.lua @@ -0,0 +1,77 @@ +local M = {} + +local snippet = { + [[ +#include + +int main() +{ + long x = 470020878965; + puts((void*)&x); // le representation + return 0; +} +]], + [[ +float Q_rsqrt( float number ) +{ + long i; + float x2, y; + const float threehalfs = 1.5F; + + x2 = number * 0.5F; + y = number; + i = * ( long * ) &y; // evil floating point bit level hacking + i = 0x5f3759df - ( i >> 1 ); // what the fuck? + y = * ( float * ) &i; + y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration +// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed + + return y; +} +]], + [[ +#include +int main(int argc, char **argv) +{ + return printf("%s: Comma operator\n", argv[0]), 2; +} +]], + [[ +void welford(double x, double *n, double *mean, double *m2) +{ + (*n)++; + double d = x - *mean; + *mean += d / *n; + *m2 += d * (x - *mean); +} +]], + [[ +#define ever (;;) + +for ever { + ... +} +]], + [[ +void *xmalloc(size_t size) +{ + void *ret = malloc(size); + if (!ret) + die("memory exhausted"); + return ret; +} +]], +} + +M.daily_random = function() + local day = tonumber(os.date("%d")) + local n = #snippet + local a = 1664525 + local c = 1013904223 + local m = 2^32 + local v = (a * day + c) % m + local r = v / m + return snippet[math.floor(r * n) + 1] +end + +return M diff --git a/fsd.vxserver.dev/www/about.lua b/fsd.vxserver.dev/www/about.lua new file mode 100644 index 0000000..44c0930 --- /dev/null +++ b/fsd.vxserver.dev/www/about.lua @@ -0,0 +1,25 @@ +local fes = require("fes") +local std = fes.std +local u = fes.util + +local site = fes.fes() + +local title = "Free Software Distributions" + +site.title = title .. "- About" +site.copyright = u.copyright("https://git.vxserver.dev/fSD", "fSD") + +site:banner(fes.app.header.render(std)) + +site:note(u.cc({ + std.h2("Free Software Distributions"), + std.p("Free Software Distributions are a collection of free, minimal, and hackable packages desinged for the similar developer: someone who values freedom in software and a partition from corporation.") +})) +site:note(u.cc({ + std.h2("Copyright and License"), + std.p("Except where otherwise stated, content on this site is copyright (C) 2025 by fSD and is made avaliable to you under the " .. fes.std.a("https://creativecommons.org/licenses/by-nc/4.0/", "Creative Commons Attribtuion-NonCommerical 4.0 International")) +})) + +site:note(fes.app.footer.render(std)) + +return site diff --git a/fsd.vxserver.dev/www/faq.lua b/fsd.vxserver.dev/www/faq.lua new file mode 100644 index 0000000..adeb762 --- /dev/null +++ b/fsd.vxserver.dev/www/faq.lua @@ -0,0 +1,27 @@ +local fes = require("fes") +local std = fes.std +local u = fes.util + +local site = fes.fes() + +local title = "Free Software Distributions" + +site.title = title .. "- FAQ" +site.copyright = u.copyright("https://git.vxserver.dev/fSD", "fSD") + +site:banner(fes.app.header.render(std)) + +site:note(u.cc({ + std.h1("Frequently Asked Questions"), + std.p("Welcome to the world of fSD, come here ye before thou ask thy stupid questions."), + std.h2("Why is it called fSD?"), + std.p([[ + The name "Free Software Distributions" is dervided from exactly what we do, we distribute free software. + This name stems from the Berkeley Software Distribution (BSD) specifically the Software Distribution part. + ]]), + std.p('It is worth pointing out that the word "free" is being used in two ways here: one meaning "at no cost" and the other meaning "do whatever you like".'), +})) + +site:note(fes.app.footer.render(std)) + +return site diff --git a/fsd.vxserver.dev/www/index.lua b/fsd.vxserver.dev/www/index.lua new file mode 100644 index 0000000..9d249d9 --- /dev/null +++ b/fsd.vxserver.dev/www/index.lua @@ -0,0 +1,28 @@ +local fes = require("fes") +local std = fes.std +local u = fes.util + +local site = fes.fes() + +local title = "Free Software Distributions" + +site.title = title +site.copyright = u.copyright("https://git.vxserver.dev/fSD", "fSD") + +site:banner(fes.app.header.render(std)) + +site:note(std.blockquote([[ +"UNIX is very simple" - Dennis Ritchie +
+"GNU's Not UNIX" - Richard Stallman +]] )) + +site:note(u.cc({ + std.h2("Daily Random Snippet"), + std.p("The following is a random code snippet that features a unique feature or syntax."), + std.blockquote(std.pre(fes.app.snippet.daily_random())), +})) + +site:note(fes.app.footer.render(std)) + +return site diff --git a/fsd.vxserver.dev/www/news.lua b/fsd.vxserver.dev/www/news.lua new file mode 100644 index 0000000..75e4540 --- /dev/null +++ b/fsd.vxserver.dev/www/news.lua @@ -0,0 +1,62 @@ +local fes = require("fes") +local std = fes.std +local u = fes.util + +local site = fes.fes() + +local title = "Free Software Distributions" + +site.title = title .. " - Site news" +site.copyright = u.copyright("https://git.vxserver.dev/fSD", "fSD") + +site:banner(fes.app.header.render(std)) + +local articles_dir = "article" +local files = {} + +local p = io.popen("ls -1 " .. articles_dir) +if p then + for file in p:lines() do + if file:match("%.md$") then + files[#files + 1] = file + end + end + p:close() +end + +table.sort(files, function(a, b) return a > b end) + +local news_html = {} +local news_titles = {} + +for _, file in ipairs(files) do + local path = articles_dir .. "/" .. file + local f = io.open(path, "r") + if f then + local content = f:read("*a") + f:close() + news_html[#news_html + 1] = fes.markdown_to_html(content) + local title_line = content:match("^#+%s*(.-)%s*\n") or "" + news_titles[#news_titles + 1] = std.h3(title_line) + end +end + +site:note(u.cc({ + std.h1("Site news - Latest"), + std.blockquote(std.p(news_html[1] or "")), +})) + +local other_titles = {} + +for i = 2, #news_titles do + other_titles[#other_titles + 1] = news_titles[i] +end + +site:note(u.cc({ + std.center(std.h2("Other")), + table.concat(other_titles, "") +})) + +site:note(fes.app.footer.render(std)) + +return site diff --git a/fsd.vxserver.dev/www/reader.lua b/fsd.vxserver.dev/www/reader.lua new file mode 100644 index 0000000..8dbc36f --- /dev/null +++ b/fsd.vxserver.dev/www/reader.lua @@ -0,0 +1,44 @@ +local fes = require("fes") +local std = fes.std +local u = fes.util + +local site = fes.fes() + +local title = "Free Software Distributions" + +site.title = title .. " - Random Article" +site:banner(std.center(std.h3(std.a("javascript:window.history.back();", "Return")))) + +math.randomseed(os.time()) + +local articles_dir = "article" +local files = {} + +local p = io.popen("ls -1 " .. articles_dir) +if p then + for file in p:lines() do + if file:match("%.md$") then + files[#files + 1] = file + end + end + p:close() +end + +local chosen = files[math.random(#files or 1)] +local content = "" + +if chosen then + local f = io.open(articles_dir .. "/" .. chosen, "r") + if f then + content = f:read("*a") + f:close() + end +end + +local html = fes.markdown_to_html(content or "") + +site:note(u.cc({ + std.div(html) +})) + +return site diff --git a/fsd.vxserver.dev/www/release.lua b/fsd.vxserver.dev/www/release.lua new file mode 100644 index 0000000..adeb762 --- /dev/null +++ b/fsd.vxserver.dev/www/release.lua @@ -0,0 +1,27 @@ +local fes = require("fes") +local std = fes.std +local u = fes.util + +local site = fes.fes() + +local title = "Free Software Distributions" + +site.title = title .. "- FAQ" +site.copyright = u.copyright("https://git.vxserver.dev/fSD", "fSD") + +site:banner(fes.app.header.render(std)) + +site:note(u.cc({ + std.h1("Frequently Asked Questions"), + std.p("Welcome to the world of fSD, come here ye before thou ask thy stupid questions."), + std.h2("Why is it called fSD?"), + std.p([[ + The name "Free Software Distributions" is dervided from exactly what we do, we distribute free software. + This name stems from the Berkeley Software Distribution (BSD) specifically the Software Distribution part. + ]]), + std.p('It is worth pointing out that the word "free" is being used in two ways here: one meaning "at no cost" and the other meaning "do whatever you like".'), +})) + +site:note(fes.app.footer.render(std)) + +return site