summaryrefslogtreecommitdiff
path: root/tools/Makefile
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2024-02-15 13:38:56 +0300
committerdefanor <defanor@uberspace.net>2024-02-15 18:22:22 +0300
commitc5ee134dbb53f9bc40d717dbc09b209807988084 (patch)
tree3cda3cca43d5f3af0b60439cd441eb482a4ad65f /tools/Makefile
parent5e8080a223d8414814032c7e3fde4e9547eacbc0 (diff)
Merge the phlog into the website
Now supporting file listings, which are used for blog posts, and generating a gophermap with their index.
Diffstat (limited to 'tools/Makefile')
-rw-r--r--tools/Makefile25
1 files changed, 23 insertions, 2 deletions
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 '<?xml version="1.0" encoding="UTF-8"?>' && \
+ echo '<files>' && \
+ ls -r blog/*.txt | \
+ sed -e "sS^blog/\(.*\)S <file src=\"\\1\" />S" && \
+ echo '</files>') \
+ > 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 '<?xml version="1.0" encoding="UTF-8"?>' && \