From c5ee134dbb53f9bc40d717dbc09b209807988084 Mon Sep 17 00:00:00 2001 From: defanor Date: Thu, 15 Feb 2024 13:38:56 +0300 Subject: Merge the phlog into the website Now supporting file listings, which are used for blog posts, and generating a gophermap with their index. --- tools/Makefile | 25 +++++++++++++++++++++++-- tools/README | 8 +++++--- tools/publish.sh | 4 ++-- tools/xml-to-html.xsl | 36 ++++++++++++++++++++++++++++-------- 4 files changed, 58 insertions(+), 15 deletions(-) (limited to 'tools') diff --git a/tools/Makefile b/tools/Makefile index c69df0a..841f093 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,8 +1,8 @@ all: $(patsubst src/%,%,$(wildcard src/notes/*.xhtml src/*.xhtml)) \ - notes/atom.xml + notes/atom.xml blog/index.xhtml blog/gophermap # Index page -index.xhtml: src/index.xhtml build/notes-by-modification-date.xml tools/xml-to-html.xsl +index.xhtml: src/index.xhtml build/notes-by-modification-date.xml build/blog.xml tools/xml-to-html.xsl xsltproc -o $@ tools/xml-to-html.xsl $< # Note index page @@ -17,6 +17,27 @@ notes/%.xhtml: src/notes/%.xhtml tools/xml-to-html.xsl %.xhtml: src/%.xhtml tools/xml-to-html.xsl xsltproc -o $@ tools/xml-to-html.xsl $< +# Blog and phlog indexes. Assuming that the blog post file names are +# prefixed with dates in a format that makes sense to sort in the +# lexiographic order. +blog/index.xhtml: src/blog/index.xhtml build/blog.xml tools/xml-to-html.xsl + xsltproc -o $@ tools/xml-to-html.xsl $< + +build/blog.xml: blog/*.txt + (echo '' && \ + echo '' && \ + ls -r blog/*.txt | \ + sed -e "sS^blog/\(.*\)S S" && \ + echo '') \ + > build/blog.xml + +blog/gophermap: blog/*.txt + (echo "!defanor's phlog" && \ + ls -r blog/*.txt | \ + sed -e "sS^blog/\(.*\)S0\\1\t\\1S" && \ + echo '.') \ + > $@ + # A single-file dump of all notes build/notes-dump.xml: src/notes/*.xhtml tools/xml-notes-dump.xsl (echo '' && \ diff --git a/tools/README b/tools/README index bbd251d..f4c1de3 100644 --- a/tools/README +++ b/tools/README @@ -21,20 +21,22 @@ Editing is done with the emacs html-mode, with Indexing: -- xml-notes-dump.xsl (with some help from publish.sh) is used to +- xml-notes-dump.xsl (with some help from Makefile) is used to create notes-dump.xml in the build directory. - xml-notes-sort.xsl sorts that to create notes-by-publication-date.xml and notes-by-modification-date.xml. - xml-notes-limit.xsl is used to extract the most recent notes. +Opaque files can be indexed externally, as done with build/blog.xml. + HTML: - xml-to-html.xsl is used to translate source files into actual (X)HTML in ~/homepage/. -Indexes can be included into those using the element (so it -should run after those are built, if they are used). +Indexes can be included into those using the or element +(so it should run after those are built, if they are used). Atom feed: diff --git a/tools/publish.sh b/tools/publish.sh index aa01628..56055ba 100755 --- a/tools/publish.sh +++ b/tools/publish.sh @@ -2,5 +2,5 @@ make -f tools/Makefile -rsync -avz *.xhtml notes pictures files uberspace.net:public_html/ -rsync -avz *.xhtml notes pictures files thunix.net:public_html/ +rsync -avz *.xhtml gophermap notes pictures files blog uberspace.net:public_html/ +rsync -avz *.xhtml gophermap notes pictures files blog thunix.net:public_html/ diff --git a/tools/xml-to-html.xsl b/tools/xml-to-html.xsl index 5785c7e..96c94c8 100644 --- a/tools/xml-to-html.xsl +++ b/tools/xml-to-html.xsl @@ -82,19 +82,18 @@ @@ -141,6 +140,27 @@ + + + +
    + + + +
+
+ + + +
  • + + + +
  • +
    + -- cgit v1.2.3