diff options
| author | Joe Carstairs <me@joeac.net> | 2026-06-09 21:02:50 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-06-09 21:02:50 +0100 |
| commit | 75f5a8bbf542493547d8e5f6d1f7921d6a854050 (patch) | |
| tree | 4a1cdf47aecbe526feab52247eab2986040b2f8d /http | |
| parent | da1670c57c9d27cc43dc19abb89f061ade9cb5e0 (diff) | |
fixes passing POST_TITLE as an arg to mkws
Diffstat (limited to 'http')
| -rw-r--r--[-rwxr-xr-x] | http/bin/blog | 2 | ||||
| -rwxr-xr-x | http/bin/mkws | 20 | ||||
| -rw-r--r-- | http/share/layouts/blog.layout.upphtml | 7 | ||||
| -rw-r--r-- | http/share/layouts/microlog.layout.upphtml | 1 |
4 files changed, 20 insertions, 10 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 diff --git a/http/share/layouts/blog.layout.upphtml b/http/share/layouts/blog.layout.upphtml index 55a790d..928733f 100644 --- a/http/share/layouts/blog.layout.upphtml +++ b/http/share/layouts/blog.layout.upphtml @@ -1,7 +1,6 @@ #! SRC="$1" SITE_URL="$2" -POST_TITLE="$3" DATE_PUBLISHED="$(basename "${SRC}" | cut -c1-10)" CANONICAL_URL="${SITE_URL}/blog/$(basename "${SRC}")" #! @@ -34,11 +33,7 @@ DATE="${DATE_PUBLISHED}" CLASS="dt-published" pp "${SHARE}/components/formatted_ </aside> <header> -<h1 class='h-name'> -#! -echo "${POST_TITLE}" -#! -</h1> +<h1 class='h-name'>${POST_TITLE}</h1> </header> <section class='e-content'> diff --git a/http/share/layouts/microlog.layout.upphtml b/http/share/layouts/microlog.layout.upphtml index 84b59c4..56c8006 100644 --- a/http/share/layouts/microlog.layout.upphtml +++ b/http/share/layouts/microlog.layout.upphtml @@ -1,7 +1,6 @@ #! SRC="$1" SITE_URL="$2" -POST_TITLE="$3" DATE_PUBLISHED="$(basename "${SRC}" | cut -c1-10)" CANONICAL_URL="${SITE_URL}/microlog/$(basename "${SRC}")" #! |
