commit 30f9bd7bf1a34781cf3159ee2e0c0ec482005197
parent e50d0409130b9c3b583396263df76a873297a290
Author: Ellenor Bjornsdottir <ellenor@umbrellix.net>
Date: Wed, 14 Sep 2022 08:26:56 +0000
Rename documents which are headered MD to .hmd, provide example compilesite.sh script for new administrators to get in business sooner, explain compilesite.sh in compilesite.hmd.
Diffstat:
3 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/doc/examples/compilesite.hmd b/doc/examples/compilesite.hmd
@@ -0,0 +1,19 @@
+Title: UmbrellixSSG Doc » Explaining compilesite.sh
+X-Synoptic-Title: UmbrellixSSG Doc » Explaining compilesite.sh
+X-Synoptic-Text: Explaining compilesite.sh - the example script for compiling an UmbrellixSSG site
+
+# compilesite.sh - the example script for compiling an UmbrellixSSG site
+
+This script expects to find ussg-page in $PATH. It also has a commented directive to "make html/style.css" which would be arcane to you if you didn't know that on both Umbrellix and ChatSpeed, 'style.css', the stylesheet those sites use, is managed through a traditional C preprocessor entry in a Makefile.
+
+The site on Umbrellix.net doesn't work well with `Make` the way ChatSpeed (a site where output and input are in the same directory) might.
+
+That said, ChatSpeed uses legacy markdown (`ussg-page -N`) as well as USSG headed markdown, so it's important that it, too, has a more intelligent system than just a Makefile.
+
+Compilesite could be at the root of a staging directory (though it should not be in your site directory itself if your web server supports CGI that way).
+
+The default compilesite looks for hmd and md format files in `src/html`, and outputs the generated html in `html`.
+
+This compilesite checks for the existence of a .hmd file with the same name as .md files it finds, as well as lone .hmd. If it finds a .hmd, it will run in headed markdown mode, and disregard any .md. If it finds only a .md, it will run in legacy mode. If it is argued with the word `quick`, it will argue ussg-page with -Q, which will ask it to not run if output is newer than input.
+
+Please tweak this script to your requirements. It is not production-ready as shipped.
diff --git a/doc/examples/compilesite.sh b/doc/examples/compilesite.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+#make html/style.css
+j=""
+if test "$1" == "quick"; then j="${j} -Q"; fi
+
+(cd src; find html -type f)|grep -E '\.(hmd|md)$'|sed -E 's/\.(hmd|md)$//g'|sort|uniq|while read i; do
+ if test ! -e src/$i.hmd; then
+ ussg-page $j -N -HM headers markdown src/$i.md $i.html
+ else
+ # prefer HMD if it exists
+ ussg-page $j -HM headers markdown src/$i.hmd $i.html
+ fi
+done
+
+tar -Chtml -cf - . | tar -C/opt/www/html -xvvf -
diff --git a/doc/interface.md b/doc/interface.hmd