From 4fb35b146e7aca6faf5945105ab36a270b7f1ad5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 24 Feb 2022 03:42:37 +0100 Subject: [PATCH] theme template and default theme --- themes/default.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 themes/default.sh 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 +} -- 2.39.2