alpha p1
This commit is contained in:
@@ -13,7 +13,33 @@ 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.")
|
||||
std.p([[
|
||||
 The Free Software Distributions, stylized as fSD, Project is a collection of
|
||||
free, minimal, and hackable packages for the similar developer: a person who
|
||||
desires freedom in their tooling and a the ability to easily continue their
|
||||
industry. Packages from fSD are built with a philosphy driven devlopment as
|
||||
their core, this process of a strong idealical foundtion makes for consistant,
|
||||
good, and dogmatic software.
|
||||
]]),
|
||||
std.p([[
|
||||
 Our philosphy has three core points: freedom, minimalism, and hackabliting:
|
||||
]]),
|
||||
std.ul({
|
||||
std.p(std.highlight("freedom: ") .. "the ability to see, touch, and smell our source code."),
|
||||
std.p(std.highlight("minimalism: ") .. ""),
|
||||
std.p(std.highlight("hackability: ") .. "packages should be easy to modify beyond their open-sourceness."),
|
||||
}),
|
||||
std.p([[
|
||||
 These core points help derive awesome software ( at least I think so ) and keep a unified focus from other developers whilst they contribute.
|
||||
]]),
|
||||
std.br(),
|
||||
std.blockquote([[
|
||||
Most of the good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program. - Linus Torvalds
|
||||
]]),
|
||||
std.br(),
|
||||
std.p([[
|
||||
 We hope that you enjoy our software and gain somethin from our time here.
|
||||
]])
|
||||
}))
|
||||
site:note(u.cc({
|
||||
std.h2("Copyright and License"),
|
||||
|
||||
@@ -7,55 +7,100 @@ 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.copyright = u.copyright("[https://git.vxserver.dev/fSD](https://git.vxserver.dev/fSD)", "fSD")
|
||||
site:banner(fes.app.header.render(std))
|
||||
|
||||
local articles_dir = "article"
|
||||
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
|
||||
end
|
||||
|
||||
local function list_files_in_dir(dir)
|
||||
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()
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
end
|
||||
|
||||
site:note(u.cc({
|
||||
std.h1("Site news - Latest"),
|
||||
std.blockquote(std.p(news_html[1] or "")),
|
||||
}))
|
||||
local dir = "news"
|
||||
local files = list_files_in_dir(dir)
|
||||
|
||||
local other_titles = {}
|
||||
|
||||
for i = 2, #news_titles do
|
||||
other_titles[#other_titles + 1] = news_titles[i]
|
||||
local params = fes.bus.params or {}
|
||||
local article = params.article
|
||||
if type(article) == "table" then
|
||||
article = article[1]
|
||||
end
|
||||
|
||||
site:note(u.cc({
|
||||
std.center(std.h2("Other")),
|
||||
table.concat(other_titles, "")
|
||||
}))
|
||||
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
|
||||
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
|
||||
end
|
||||
|
||||
if n > 0 then
|
||||
site:h1("Site news")
|
||||
site:note(std.ul(articles))
|
||||
else
|
||||
site:h1("No articles")
|
||||
end
|
||||
|
||||
site:note(fes.app.footer.render(std))
|
||||
|
||||
|
||||
@@ -1,25 +1,34 @@
|
||||
local fes = require("fes")
|
||||
local std = fes.std
|
||||
local u = fes.util
|
||||
local u = fes.util
|
||||
|
||||
local site = fes.fes()
|
||||
|
||||
local title = "Free Software Distributions"
|
||||
|
||||
site.title = title .. "- FAQ"
|
||||
site.title = title .. " - Release"
|
||||
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".'),
|
||||
local pkgs = {
|
||||
{ "yait", "Highly opinionated C and SH project generator." },
|
||||
{ "fes", "A lightweight, static, and opinionated microframework." },
|
||||
}
|
||||
|
||||
for i, pkg in pairs(pkgs) do
|
||||
pkgs[i] = std.note(u.cc({
|
||||
std.h2(pkg[1]),
|
||||
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")),
|
||||
}),
|
||||
}))
|
||||
end
|
||||
|
||||
site:custom(u.cc({
|
||||
u.cc(pkgs),
|
||||
}))
|
||||
|
||||
site:note(fes.app.footer.render(std))
|
||||
|
||||
Reference in New Issue
Block a user