summaryrefslogtreecommitdiff
path: root/http/bin
diff options
context:
space:
mode:
Diffstat (limited to 'http/bin')
-rw-r--r--[-rwxr-xr-x]http/bin/blog2
-rwxr-xr-xhttp/bin/mkws20
2 files changed, 19 insertions, 3 deletions
diff --git a/http/bin/blog b/http/bin/blog
index 357b2bc..46c050a 100755..100644
--- a/http/bin/blog
+++ b/http/bin/blog
@@ -92,6 +92,6 @@ do
export POST_TITLE="$title"
cat "$entry" | grep --regexp "^\# " --invert-match | eval "$postprocess_cmd" > "$dest"
fi
- echo "${title}" > "${dest}.args"
+ echo "POST_TITLE=\"$(echo "${title}" | sed "s/\\\"/\\\\\"/g")\"" > "${dest}.args"
echo "Processed ${entry#$(dirname ${BLOGS})/} to ${dest#$(dirname ${SRC})/}"
done
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