From 3bf0193e01f7d9460a422da25e8645ee3bc686a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?cat=20=C3=A6scling?= Date: Mon, 23 Feb 2026 01:33:41 -0500 Subject: [PATCH] initial commit * make unformatted articles depend on their template * output to ./aescling.cat.family/blog * create Atom feed * prevent full rebuilds by preserving all intermediates * create
s instead of
s * make all rule more robust * change output directory and relevant paths for new URL * add footer and some styling * link to home from article view * fix link styling * do the box lifted off the background thing * add limited OpenGraph suppurrt * use outset berder-style * title the blog * tweak styling --- Makefile | 56 ++++++++++++++++++ README.md | 16 ++++++ blog.aescling.cat.family/.gitkeep | 0 source/.gitkeep | 0 temp/.gitkeep | 0 template/article.xhtml.template | 94 +++++++++++++++++++++++++++++++ template/atom.xml.template | 6 ++ template/index.xhtml.template | 89 +++++++++++++++++++++++++++++ 8 files changed, 261 insertions(+) create mode 100644 Makefile create mode 100644 README.md create mode 100644 blog.aescling.cat.family/.gitkeep create mode 100644 source/.gitkeep create mode 100644 temp/.gitkeep create mode 100644 template/article.xhtml.template create mode 100644 template/atom.xml.template create mode 100644 template/index.xhtml.template diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..55a22f7 --- /dev/null +++ b/Makefile @@ -0,0 +1,56 @@ +OUTDIR=blog.aescling.cat.family + +ARTICLES=$(wildcard source/*.djot) +_UNFORMATTED_ARTICLES=$(ARTICLES:.djot=.unformatted) +UNFORMATTED_ARTICLES=$(patsubst source/%, temp/%, $(_UNFORMATTED_ARTICLES)) +_FORMATTED_ARTICLES=$(UNFORMATTED_ARTICLES:.unformatted=.xhtml) +# putting these in $(OUTDIR) will make the links from index.xhtml point to +# `out/$BASENAME.xhtml`, instead of `$BASENAME.xhtml`; we will move them later +FORMATTED_ARTICLES=$(patsubst temp/%, %, $(_FORMATTED_ARTICLES)) + +# don't delete intermediate files when done; otherwise we always full rebuild +.SECONDARY: + +all: $(OUTDIR)/index.xhtml $(OUTDIR)/atom.xml + for f in $(FORMATTED_ARTICLES); do \ + [ -f "$$f" ] || exit 0; \ + done && mv $(FORMATTED_ARTICLES) $(OUTDIR) + +$(OUTDIR)/index.xhtml: temp/index.unformatted_index + hxnormalize -x $< >$@ + +temp/index.unformatted_index: $(FORMATTED_ARTICLES) template/index.xhtml.template + sblg -t template/index.xhtml.template -s rdate -o $@ $(FORMATTED_ARTICLES) + +%.xhtml: temp/%.unformatted + hxnormalize -x $< >$@ + +temp/%.unformatted: temp/%.fragment template/article.xhtml.template + sblg -t template/article.xhtml.template -c -o $@ $< + +# the djot file MUST generate content surrounded by +# +# ``` +#
+# ... +#
+# ``` +# +# however, fur semantic reasons, we purrefur `
` to `
` +# +# the hxextract(1) invocation is redundant unless the djot source file is +# pathological, containing content befur or after the div +temp/%.fragment: source/%.djot + { echo '
'; \ + djot $< | hxextract .article - | sed '1d; $$d'; \ + echo '
'; } >$@ + +$(OUTDIR)/atom.xml: temp/atom.unformatted_atom + hxnormalize -x $< >$@ + +temp/atom.unformatted_atom: $(FORMATTED_ARTICLES) template/atom.xml.template + sblg -t template/atom.xml.template -a -o $@ $(FORMATTED_ARTICLES) + +clean: + rm temp/* + rm $(OUTDIR)/* diff --git a/README.md b/README.md new file mode 100644 index 0000000..261de99 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# cat æscling’s blog sources + +this repository contains the sources and GNU Makefile used to build my new blog +in purrogress + +source files are written in [djot] and converted to XML-compliant HTML with +[djot.js][djot-js]. those (X)HTML files are converted into the suitable XHTML +for the blog with [sblg], which is all then autofurmatted with +[hxnormalize][html-xml-utils] + +sblg is also used to build an Atom feed + +[djot]: https://www.djot.net/ +[djot-js]: https://github.com/jgm/djot.js +[html-xml-utils]: https://www.w3.org/Tools/HTML-XML-utils/ +[sblg]: https://kristaps.bsd.lv/sblg diff --git a/blog.aescling.cat.family/.gitkeep b/blog.aescling.cat.family/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/source/.gitkeep b/source/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/temp/.gitkeep b/temp/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/template/article.xhtml.template b/template/article.xhtml.template new file mode 100644 index 0000000..5d00d69 --- /dev/null +++ b/template/article.xhtml.template @@ -0,0 +1,94 @@ + + + + + + + + + ${sblg-titletext}: of smoke and æsc + + + + +
+

of smoke and æsc

+ +

a blog by cat æscling

+
+ +
+ + + + diff --git a/template/atom.xml.template b/template/atom.xml.template new file mode 100644 index 0000000..43a8944 --- /dev/null +++ b/template/atom.xml.template @@ -0,0 +1,6 @@ + + + +cat æscling: blog + diff --git a/template/index.xhtml.template b/template/index.xhtml.template new file mode 100644 index 0000000..d1b0e68 --- /dev/null +++ b/template/index.xhtml.template @@ -0,0 +1,89 @@ + + + + + + + + + + of smoke and æsc: a blog by cat æscling + + + + +
+

of smoke and æsc

+ +

a blog by cat æscling

+
+ + + + + + -- 2.47.3