From: Paul Hänsch Date: Tue, 4 Nov 2025 12:07:51 +0000 (+0100) Subject: handler for exporting plain html pages X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=ba70f39801a96331e1885967a8a41b523ca6350f;p=shellwiki handler for exporting plain html pages --- diff --git a/handlers/29_html_export.sh b/handlers/29_html_export.sh new file mode 100755 index 0000000..c1ebc87 --- /dev/null +++ b/handlers/29_html_export.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +[ "$HTML_EXPORT" ] || return 1 + +. "$_EXEC/cgilite/file.sh" + +case "${PATH_INFO}" in + /"[.]"/*) + :;; + *${BR}*) + :;; + */\#*) + :;; + */\[*\]/*|*/\[*\]) + :;; + */) + if mdfile "$PATH_INFO" >&- \ + && acl_read "$PATH_INFO"; then + mkdir -p "${HTML_EXPORT}${PATH_INFO}" + ( unset USER_NAME + acl_read "$PATH_INFO" \ + && theme_page "${PATH_INFO}" \ + | tee "${HTML_EXPORT}${PATH_INFO}/index.html" + ) && return 0 + fi + ;; +esac + +return 1