site

scripts to generate personal blog and git repositories

git clone https://9o.is/git/site.git

commit 2db086b3e8af091e68d678b4b4bb55c0661e1904
parent e653a06d7eeaf603dda750a084b365627903759a
Author: Jul <jul@9o.is>
Date:   Thu,  8 Jan 2026 01:26:31 -0500

introduce partials

Diffstat:
MMakefile | 12++++++++----
Mconfig.cfg | 5++++-
Apartials/head.html | 11+++++++++++
Apartials/head_blog.html | 2++
Apartials/nav.html | 10++++++++++
Mtemplates/index.html/header.html | 26+++-----------------------
Mtemplates/page/header.html | 26+++-----------------------
7 files changed, 41 insertions(+), 51 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,12 +1,16 @@ BROWSER := brave-browser +OUTDIR := output generate: - mkdir -p output + mkdir -p $(OUTDIR) find pages -type f -name '*.cfg' -print0 | sort -zr | xargs -0 saait - cp style.css print.css output/ + cp style.css print.css $(OUTDIR) -preview: - $(BROWSER) output/index.html +preview: generate + $(BROWSER) $(OUTDIR)/index.html sync: generate rclone sync -vu output sftp:htdocs + +clean: + rm -rf $(OUTDIR) diff --git a/config.cfg b/config.cfg @@ -4,6 +4,9 @@ siteurl = https://qh.is sitegenerator = saait (https://git.codemadness.org/saait/file/README.html) lang = en author = Jul -keywords = blog, code +keywords = code description = blog with various projects and articles about computer-related things title = +partial_nav = partials/nav.html +partial_head = partials/head.html +partial_head_blog = partials/head_blog.html diff --git a/partials/head.html b/partials/head.html @@ -0,0 +1,11 @@ +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<meta http-equiv="Content-Language" content="${lang}" /> +<meta name="viewport" content="width=device-width" /> +<meta name="keywords" content="${keywords}" /> +<meta name="description" content="${description}" /> +<meta name="author" content="${author}" /> +<meta name="generator" content="${sitegenerator}" /> +<link rel="stylesheet" href="style.css" type="text/css" media="screen" /> +<link rel="stylesheet" href="print.css" type="text/css" media="print" /> +<link rel="icon" href="/favicon.png" type="image/png" /> +<meta name="darkreader-lock"> diff --git a/partials/head_blog.html b/partials/head_blog.html @@ -0,0 +1,2 @@ +<link rel="alternate" href="atom.xml" type="application/atom+xml" title="${sitetitle} Atom Feed" /> +<link rel="alternate" href="atom_content.xml" type="application/atom+xml" title="${sitetitle} Atom Feed with content" /> diff --git a/partials/nav.html b/partials/nav.html @@ -0,0 +1,10 @@ +<nav id="menuwrap"> + <table id="menu" width="100%" border="0"> + <tr> + <td id="links" align="left"> + <a href="/">Blog</a> | + <a href="/git" title="Git repository with some of my projects">Git</a> + </td> + </tr> + </table> +</nav> diff --git a/templates/index.html/header.html b/templates/index.html/header.html @@ -1,32 +1,12 @@ <!DOCTYPE html> <html dir="ltr" lang="${lang}"> <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <meta http-equiv="Content-Language" content="${lang}" /> - <meta name="viewport" content="width=device-width" /> - <meta name="keywords" content="${keywords}" /> - <meta name="description" content="${description}" /> - <meta name="author" content="${author}" /> - <meta name="generator" content="${sitegenerator}" /> + %{partial_head} + %{partial_head_blog} <title>Posts - ${sitetitle}</title> - <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> - <link rel="stylesheet" href="print.css" type="text/css" media="print" /> - <link rel="alternate" href="atom.xml" type="application/atom+xml" title="${sitetitle} Atom Feed" /> - <link rel="alternate" href="atom_content.xml" type="application/atom+xml" title="${sitetitle} Atom Feed with content" /> - <link rel="icon" href="/favicon.png" type="image/png" /> - <meta name="darkreader-lock"> </head> <body> - <nav id="menuwrap"> - <table id="menu" width="100%" border="0"> - <tr> - <td id="links" align="left"> - <a href="index.html">Blog</a> | - <a href="/git/" title="Git repository with some of my projects">Git</a> - </td> - </tr> - </table> - </nav> + %{partial_nav} <hr class="hidden" /> <main id="mainwrap"> <div id="main"> diff --git a/templates/page/header.html b/templates/page/header.html @@ -1,32 +1,12 @@ <!DOCTYPE html> <html dir="ltr" lang="${lang}"> <head> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <meta http-equiv="Content-Language" content="${lang}" /> - <meta name="viewport" content="width=device-width" /> - <meta name="keywords" content="${keywords}" /> - <meta name="description" content="${description}" /> - <meta name="author" content="${author}" /> - <meta name="generator" content="${sitegenerator}" /> + %{partial_head} + %{partial_head_blog} <title>${title} - ${sitetitle}</title> - <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> - <link rel="stylesheet" href="print.css" type="text/css" media="print" /> - <link rel="alternate" href="atom.xml" type="application/atom+xml" title="${sitetitle} Atom Feed" /> - <link rel="alternate" href="atom_content.xml" type="application/atom+xml" title="${sitetitle} Atom Feed with content" /> - <link rel="icon" href="/favicon.png" type="image/png" /> - <meta name="darkreader-lock"> </head> <body> - <nav id="menuwrap"> - <table id="menu" width="100%" border="0"> - <tr> - <td id="links" align="left"> - <a href="index.html">Blog</a> | - <a href="/git/" title="Git repository with some of my projects">Git</a> - </td> - </tr> - </table> - </nav> + %{partial_nav} <hr class="hidden" /> <main id="mainwrap"> <div id="main">