summaryrefslogtreecommitdiff
path: root/http/bin/mkws
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-06-09 21:02:50 +0100
committerJoe Carstairs <me@joeac.net>2026-06-09 21:02:50 +0100
commit75f5a8bbf542493547d8e5f6d1f7921d6a854050 (patch)
tree4a1cdf47aecbe526feab52247eab2986040b2f8d /http/bin/mkws
parentda1670c57c9d27cc43dc19abb89f061ade9cb5e0 (diff)
fixes passing POST_TITLE as an arg to mkws
Diffstat (limited to 'http/bin/mkws')
-rwxr-xr-xhttp/bin/mkws20
1 files changed, 18 insertions, 2 deletions
diff --git a/http/bin/mkws b/http/bin/mkws
index 9cd2bee..b005500 100755
--- a/http/bin/mkws
+++ b/http/bin/mkws
@@ -51,14 +51,30 @@ do
mkdir -p "${OUT}/${rel_dir}/"
args="$( [ -f "${t}.args" ] && cat "${t}.args" || echo "" )"
+ if [ "$(head -n 1 "${layout}")" = "#!" ]
+ then
+ >"${layout}.tmp" echo "
+#!
+${args}
+$(tail -n +2 "${layout}")
+"
+ else
+ >"${layout}.tmp" echo "
+#!
+${args}
+#!
+$(cat "${layout}")
+"
+ fi
if [ "$ext" = "html" ]
then
- pp "${layout}" "${t}" "$1" "$args" > \
+ pp "${layout}.tmp" "${t}" "${1}" > \
"${OUT}/${rel_dir}/${name}.${ext}"
else
- pp "${t}" "$1" "$args" > \
+ pp "${t}" "${1}" > \
"${OUT}/${rel_dir}/${name}.${ext}"
fi
+
echo "Written ${OUT}/${rel_dir}${name}.${ext}"
done