From: Paul Hänsch Date: Thu, 24 Feb 2022 02:42:37 +0000 (+0100) Subject: theme template and default theme X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=4fb35b146e7aca6faf5945105ab36a270b7f1ad5;p=shellwiki theme template and default theme --- diff --git a/themes/default.sh b/themes/default.sh new file mode 100755 index 0000000..6370166 --- /dev/null +++ b/themes/default.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +theme_404(){ + printf "%s\r\n" "Status: 404 Not Found" + + theme_page '/[404]/' +} + +theme_page(){ + local page="$1" title + title="${page%/}"; title="${title##*/}" + + printf "%s\r\n" "Content-Type: text/html; charset=utf-8" "" + + cat <<-EOF + + + + + $(HTML "${title}") + +
+
$(wiki "$page" || printf 'Page not found')
+ + + EOF +}