ci: order articles in post evaluation
All checks were successful
Deploy Blog / build (push) Successful in 18s
All checks were successful
Deploy Blog / build (push) Successful in 18s
This commit is contained in:
parent
fe84bb95d9
commit
91cf97e449
2 changed files with 23 additions and 23 deletions
|
@ -23,7 +23,7 @@ jobs:
|
|||
apt update
|
||||
apt install -y curl libluajit-5.1-2 unzip
|
||||
|
||||
curl -L https://git.mzte.de/LordMZTE/confgen/releases/download/v0.3.1/confgen-linux-x86_64.zip -o confgen.zip
|
||||
curl -L https://git.mzte.de/LordMZTE/confgen/releases/download/v0.4.0/confgen-linux-x86_64.zip -o confgen.zip
|
||||
unzip confgen.zip -d /tmp/confgen
|
||||
|
||||
curl -L https://github.com/tree-sitter/tree-sitter/releases/download/v0.22.6/tree-sitter-linux-x64.gz | gunzip >/tmp/tree-sitter
|
||||
|
@ -37,7 +37,7 @@ jobs:
|
|||
git clone https://git.mzte.de/coding-agent/ts-parsers.git
|
||||
mv ts-parsers /tmp/
|
||||
|
||||
/tmp/confgen/bin/confgen confgen.lua _site/
|
||||
/tmp/confgen/bin/confgen confgen.lua _site/ --post-eval "cg.opt.articles = GetArticles()"
|
||||
- name: Rsync deployments
|
||||
uses: https://github.com/burnett01/rsync-deployments@5.2
|
||||
with:
|
||||
|
|
42
confgen.lua
42
confgen.lua
|
@ -3,19 +3,7 @@ cg.addPath('scripts')
|
|||
cg.addFile('index.html.cgt')
|
||||
cg.addFile('style.css.cgt')
|
||||
|
||||
local function getArticles()
|
||||
local list = {}
|
||||
|
||||
for file in io.popen('ls articles/'):lines() do
|
||||
if file:sub(-4) == ".lua" then
|
||||
local article = loadfile("articles/" .. file)()
|
||||
if article then
|
||||
article.file = file:gsub("%.lua$", ".html")
|
||||
list[file:gsub("%.lua$", "")] = article
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function orderArticles(list)
|
||||
local function dateToNumber(date_str)
|
||||
local day, month, year = date_str:match("(%d%d)-(%d%d)-(%d%d%d%d)")
|
||||
return tonumber(year .. month .. day)
|
||||
|
@ -28,9 +16,27 @@ local function getArticles()
|
|||
return list
|
||||
end
|
||||
|
||||
cg.opt.articles = getArticles();
|
||||
cg.opt.style = require('style')
|
||||
function GetArticles()
|
||||
local list = {}
|
||||
|
||||
for file in io.popen('ls articles/'):lines() do
|
||||
if file:sub(-4) == ".lua" then
|
||||
local article = loadfile("articles/" .. file)()
|
||||
if article then
|
||||
article.file = file:gsub("%.lua$", ".html")
|
||||
list[file:gsub("%.lua$", "")] = article
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return orderArticles(list)
|
||||
end
|
||||
|
||||
local email = "info@coding-agent.me"
|
||||
local github = "https://github.com/coding-agent/"
|
||||
|
||||
cg.opt.highlight = require("highlight")
|
||||
cg.opt.style = require('style')
|
||||
cg.opt.doctype = "<!doctype html>"
|
||||
cg.opt.header_links = [[
|
||||
<meta charset="UTF-8">
|
||||
|
@ -46,10 +52,6 @@ cg.opt.header_links = [[
|
|||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Share+Tech&display=swap" rel="stylesheet">
|
||||
]]
|
||||
|
||||
email = "info@coding-agent.me"
|
||||
github = "https://github.com/coding-agent/"
|
||||
|
||||
cg.opt.menu = [[
|
||||
<div class="menu">
|
||||
<a href="index.html"><i class="fa-solid fa-house"></i> Home </a>
|
||||
|
@ -57,5 +59,3 @@ cg.opt.menu = [[
|
|||
<a href="]].. github ..[["> <i class="fa-brands fa-github"></i> Github </a>
|
||||
</div>
|
||||
]]
|
||||
|
||||
cg.opt.highlight = require("highlight")
|
||||
|
|
Loading…
Reference in a new issue