tSupport generating a gophermap with markdown sources - monochromatic - monochromatic blog: http://blog.z3bra.org
(HTM) git clone git://z3bra.org/monochromatic
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 4c6e7eb55bbdaf39839fb6ab20e1200f1374b1ae
(DIR) parent 7aa0d9027793b88b5f70b1b328a7fcc0cb479024
(HTM) Author: Willy Goiffon <dev@z3bra.org>
Date: Fri, 27 Dec 2019 13:54:46 +0100
Support generating a gophermap with markdown sources
Diffstat:
M Makefile | 9 +++++++--
A utils/gophermap.sh | 16 ++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
t@@ -1,10 +1,12 @@
include config.mk
-.PHONY: all release install clean
+.PHONY: all release gopher-release install clean
.SUFFIXES: .txt .html
all: $(FEEDS) $(EXTRA) $(PAGES)
release: $(TARBALL)
+gopher-release: index.gph
+ tar -cjf $(TARBALL) `find . -name '*.txt' -o -name '*.gph'`
$(TARBALL): $(FEEDS) $(PAGES) $(EXTRA)
tar -cjf $@ $(PAGES) $(EXTRA) $(FEEDS)
t@@ -12,6 +14,9 @@ $(TARBALL): $(FEEDS) $(PAGES) $(EXTRA)
index.txt:
sh utils/genindex.sh > $@
+index.gph:
+ sh utils/gophermap.sh > $@
+
$(FEEDS): index.txt
mkdir -p `dirname $@`
sed -Ef utils/feed.sed < index.txt > $@
t@@ -24,5 +29,5 @@ install: $(TARBALL)
tar -xjf $(NAME).tar.bz2 -C $(PREFIX)
clean:
- rm -f $(PAGES) $(FEEDS) $(TARBALL) index.txt
+ rm -f $(PAGES) $(FEEDS) $(TARBALL) index.txt index.gph
rmdir `dirname $(FEEDS)`
(DIR) diff --git a/utils/gophermap.sh b/utils/gophermap.sh
t@@ -0,0 +1,16 @@
+#!/bin/sh
+
+printf 'z3bra.org - monochromatic blog\n'
+printf '==============================\n\n'
+
+i=0
+for post in $(find 20* -type f -name '*.txt' ! -name 'index.txt'|sort); do
+ title="$(sed -n 's/^# \[\(.*\)\].*$/\1/p' $post)"
+ href="/monochromatic/$post"
+ printf '[0|0x%04x - %s|%s|server|port]\n' "$i" "$title" "$href"
+ i=$((i+1))
+done | sort -r
+
+printf '\n'
+printf '[h|https://blog.z3bra.org|URL:https://blog.z3bra.org|server|port]\n'
+printf '[h|© ISC|URL:https://www.isc.org/licenses/|server|port]\n'