From 38972ae499826bc61e56f52fa74ced447c5dd056 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sat, 18 Mar 2023 04:28:55 +0900 Subject: Automate generation process --- .gitignore | 3 ++- Makefile | 25 +++++++++++++++++++++++++ README.md | 4 +++- shell.nix | 2 +- xhtml.xslt | 19 +++++++++++++++++++ 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 Makefile create mode 100644 xhtml.xslt diff --git a/.gitignore b/.gitignore index 2d19fc7..ab47213 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.html +gemini/ +www/ 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 diff --git a/README.md b/README.md index 952f856..035689a 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,13 @@ interoperability, privacy and reproducibility ## services +* cgit (git web frontend) at [trong.loang.net](https://trong.loang.net) * dendrite (matrix server) at [loang.net](https://loang.net/_matrix/federation/v1/version) * element (matrix client) at [than.loang.net](https://than.loang.net) * ipfs node and gateway at [loang.net](https://loang.net) * knot (authoritative name server) at danh.loang.net +* laminar (automation logs) at [xong.loang.net](https://xong.loang.net) * molly brown (gemini server) at [loang.net](gemini://loang.net) * nginx (web server) at [loang.net](https://loang.net) * nix environment (through ssh) at [loang.net:2211](ssh://loang.net:2211) @@ -23,7 +25,7 @@ interoperability, privacy and reproducibility ## contacts -* matrix room: [#meta:loang.net](matrix:r/meta:loang.net) +* matrix room: [#chung:loang.net](matrix:r/chung:loang.net) * mailing list: [~cnx/loang@lists.sr.ht](https://lists.sr.ht/~cnx/loang) * tickets: [~cnx/loang@todo.sr.ht](https://todo.sr.ht/~cnx/loang) diff --git a/shell.nix b/shell.nix index d9a4d65..bbadc58 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ with import {}; mkShell { - nativeBuildInputs = [ discount md2gemini ]; + nativeBuildInputs = [ discount libxslt md2gemini ]; } diff --git a/xhtml.xslt b/xhtml.xslt new file mode 100644 index 0000000..2bdb370 --- /dev/null +++ b/xhtml.xslt @@ -0,0 +1,19 @@ + + + + + + + + + + + <xsl:value-of select="(//xhtml:h1)[1]"/> + + + + + -- cgit 1.4.1