From ba70f39801a96331e1885967a8a41b523ca6350f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 4 Nov 2025 13:07:51 +0100 Subject: [PATCH] handler for exporting plain html pages --- handlers/29_html_export.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 handlers/29_html_export.sh 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 -- 2.39.5