about summary refs log tree commit diff homepage
path: root/Makefile
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2023-03-18 04:28:55 +0900
committerNguyễn Gia Phong <mcsinyx@disroot.org>2023-03-18 04:28:55 +0900
commit38972ae499826bc61e56f52fa74ced447c5dd056 (patch)
tree41d999d3c96986a58a7871ca9015fb1ffe3236dd /Makefile
parent5b56f1c5e757fc7165efac2b0c9e14583095ad81 (diff)
downloadsite-38972ae499826bc61e56f52fa74ced447c5dd056.tar.gz
Automate generation process
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d865ae7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+SHELL = /bin/sh
+
+MD = $(shell find . -name '[!README]*.md')
+GMI := $(patsubst %.md,gemini/%.gmi,$(MD:./%=%))
+XHTML := $(patsubst %.md,www/%.xhtml,$(MD:./%=%))
+
+all: gemini www
+
+%/:
+	mkdir $@
+
+gemini/%.gmi: %.md
+	md2gemini --links=paragraph < $< > $@
+
+gemini: gemini/ $(GMI)
+
+www/%.xhtml: %.md
+	makepage < $< | xsltproc xhtml.xslt - > $@
+
+www: www/ $(XHTML)
+
+clean:
+	rm -f $(GMI) $(XHTML)
+
+.PHONY: all gemini www