chore: various cleanups
This commit is contained in:
parent
c7c7500161
commit
f5101c2f70
15 changed files with 84 additions and 59 deletions
35
.github/workflows/deploy.yml
vendored
Normal file
35
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
name: Deploy Blog
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: debian-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@v3
|
||||
- name: Install and run Confgen
|
||||
run: |
|
||||
sudo apt install -y curl libluajit-5.1-2 unzip
|
||||
curl -L https://git.mzte.de/LordMZTE/confgen/releases/download/v0.2.2/confgen-linux-x86_64.zip -o confgen.zip
|
||||
unzip confgen.zip -d /tmp/confgen
|
||||
/tmp/confgen/bin/confgen confgen.lua _site
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v2
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{steps.deployment.outputs.page_url}}
|
||||
runs-on: debian-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v2
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
_site/
|
|
@ -1,8 +1,9 @@
|
|||
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>How to Build a Blog the Hard Way?</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<title>How to make a blog the hard way?</title>
|
||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Share+Tech&display=swap" rel="stylesheet">
|
||||
|
@ -10,7 +11,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h2>How to build a blog the hard way?</h2>
|
||||
<h2>14-04-2024 - How to make a blog the hard way?</h2>
|
||||
</div>
|
||||
|
||||
</body>
|
|
@ -4,7 +4,7 @@
|
|||
<title>Coding Agent's Blog</title>
|
||||
<meta name="description" content="Personal blog page">
|
||||
<meta name="keywords" content="coding-agent blog">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Share+Tech&display=swap" rel="stylesheet">
|
||||
|
@ -19,8 +19,8 @@
|
|||
<div class="content">
|
||||
<h2> Articles </h2>
|
||||
|
||||
<a href="how-to-make-a-blog-the-hard-way.html" class="article">
|
||||
<h3>How to make a website the hard way? <sup>eng</sup></h3>
|
||||
<a href="articles/how-to-make-a-blog-the-hard-way.html" class="article">
|
||||
<h3>How to make a blog the hard way? <sup>eng</sup></h3>
|
||||
<hr>
|
||||
<div class="article_footer">
|
||||
14-04-2024
|
|
@ -36,7 +36,7 @@ body{
|
|||
|
||||
|
||||
.article:hover {
|
||||
background: #E1E1E!;
|
||||
background: #E1E1E1;
|
||||
color: #8888FF;
|
||||
}
|
||||
|
13
articles/how-to-make-a-blog-the-hard-way.html.cgt
Normal file
13
articles/how-to-make-a-blog-the-hard-way.html.cgt
Normal file
|
@ -0,0 +1,13 @@
|
|||
<! local article = opt.articles["how-to-make-a-blog-the-hard-way"] !>
|
||||
<% opt.doctype %>
|
||||
<html>
|
||||
<head>
|
||||
<title><% article.title %></title>
|
||||
<% opt.header_links %>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h2><% article.date %> - <% article.title %></h2>
|
||||
</div>
|
||||
|
||||
</body>
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
title = "How to make a website the hard way?",
|
||||
title = "How to make a blog the hard way?",
|
||||
lang = "eng",
|
||||
date = "14-04-2024",
|
||||
}
|
24
confgen.lua
Normal file
24
confgen.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
cg.addFile('index.html.cgt')
|
||||
cg.addFile('style.css.cgt')
|
||||
|
||||
cg.opt.articles = {}
|
||||
|
||||
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 = "articles/" .. file:gsub("%.lua$", ".html")
|
||||
cg.addFile(article.file .. ".cgt")
|
||||
cg.opt.articles[file:gsub("%.lua$", "")] = article;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
cg.opt.style = require('style')
|
||||
cg.opt.doctype = "<!doctype html>"
|
||||
cg.opt.header_links = [[
|
||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Share+Tech&display=swap" rel="stylesheet">
|
||||
]]
|
|
@ -1,2 +0,0 @@
|
|||
cd src/
|
||||
confgen confgen.lua ../
|
|
@ -1,5 +0,0 @@
|
|||
return {
|
||||
title = "How to make a website the hard way?",
|
||||
lang = "eng",
|
||||
date = "14-04-2024",
|
||||
}
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<div class="content">
|
||||
<h2> Articles </h2>
|
||||
<! for _, article in ipairs(opt.articles) do !>
|
||||
<! for _, article in pairs(opt.articles) do !>
|
||||
<a href="<% article.file %>" class="article">
|
||||
<h3><% article.title %> <sup><% article.lang %></sup></h3>
|
||||
<hr>
|
|
@ -1,12 +0,0 @@
|
|||
<% opt.doctype %>
|
||||
<html>
|
||||
<head>
|
||||
<title>How to Build a Blog the Hard Way?</title>
|
||||
<% opt.header_links %>
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h2>How to build a blog the hard way?</h2>
|
||||
</div>
|
||||
|
||||
</body>
|
|
@ -1,30 +0,0 @@
|
|||
cg.addPath('articles', '.')
|
||||
|
||||
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")
|
||||
table.insert(list, article)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return list
|
||||
end
|
||||
|
||||
cg.opt.articles = getArticles();
|
||||
cg.opt.style = require('style')
|
||||
cg.opt.doctype = "<!doctype html>"
|
||||
cg.opt.header_links = [[
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Share+Tech&display=swap" rel="stylesheet">
|
||||
]]
|
|
@ -1,7 +1,7 @@
|
|||
local style = {}
|
||||
|
||||
style.background = '#202020'
|
||||
style.sub_background = '#E1E1E!'
|
||||
style.sub_background = '#E1E1E1'
|
||||
style.text = 'FFFFFF'
|
||||
style.sub_text = '#F7A41D'
|
||||
style.blue = '#8888FF'
|
Loading…
Reference in a new issue