alpha commit
This commit is contained in:
9
fsd.vxserver.dev/Fes.toml
Normal file
9
fsd.vxserver.dev/Fes.toml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[site]
|
||||||
|
|
||||||
|
name = "site"
|
||||||
|
version = "0.0.1"
|
||||||
|
authors = ["owen"]
|
||||||
|
|
||||||
|
[fes]
|
||||||
|
version = "1.0.0"
|
||||||
|
CUSTOM_CSS =
|
||||||
10
fsd.vxserver.dev/article/alpha-release.md
Normal file
10
fsd.vxserver.dev/article/alpha-release.md
Normal file
@@ -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 <https://git.vxserver.dev/fSD/site>.
|
||||||
|
|
||||||
|
2025-28-11
|
||||||
3
fsd.vxserver.dev/article/holiday-season.md
Normal file
3
fsd.vxserver.dev/article/holiday-season.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
### Holiday Season
|
||||||
|
|
||||||
|
Merry Christmas and Happy Holidays!
|
||||||
BIN
fsd.vxserver.dev/include/favicon.ico
Normal file
BIN
fsd.vxserver.dev/include/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
13
fsd.vxserver.dev/include/footer.lua
Normal file
13
fsd.vxserver.dev/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", "Git Trees"),
|
||||||
|
std.external("https://git.vxserver.dev/fSD", "Documentation"),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return footer
|
||||||
15
fsd.vxserver.dev/include/header.lua
Normal file
15
fsd.vxserver.dev/include/header.lua
Normal file
@@ -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
|
||||||
77
fsd.vxserver.dev/include/snippet.lua
Normal file
77
fsd.vxserver.dev/include/snippet.lua
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
local snippet = {
|
||||||
|
[[
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
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 <stdio.h>
|
||||||
|
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
|
||||||
25
fsd.vxserver.dev/www/about.lua
Normal file
25
fsd.vxserver.dev/www/about.lua
Normal file
@@ -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
|
||||||
27
fsd.vxserver.dev/www/faq.lua
Normal file
27
fsd.vxserver.dev/www/faq.lua
Normal file
@@ -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
|
||||||
28
fsd.vxserver.dev/www/index.lua
Normal file
28
fsd.vxserver.dev/www/index.lua
Normal file
@@ -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
|
||||||
|
<br>
|
||||||
|
"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
|
||||||
62
fsd.vxserver.dev/www/news.lua
Normal file
62
fsd.vxserver.dev/www/news.lua
Normal file
@@ -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
|
||||||
44
fsd.vxserver.dev/www/reader.lua
Normal file
44
fsd.vxserver.dev/www/reader.lua
Normal file
@@ -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
|
||||||
27
fsd.vxserver.dev/www/release.lua
Normal file
27
fsd.vxserver.dev/www/release.lua
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user