aboutsummaryrefslogtreecommitdiff
path: root/v2/src/bin/conf
diff options
context:
space:
mode:
Diffstat (limited to 'v2/src/bin/conf')
-rwxr-xr-xv2/src/bin/conf18
1 files changed, 16 insertions, 2 deletions
diff --git a/v2/src/bin/conf b/v2/src/bin/conf
index 92ecc68..e4dba61 100755
--- a/v2/src/bin/conf
+++ b/v2/src/bin/conf
@@ -154,6 +154,20 @@ if [ -z "${title:-}" ]; then
printf 'export title="%s"\n' "$(printf '%s' "$title" | shesc)"
fi
+if [ -r "$FILENAME".i18n ]; then
+ translations="$(cat <<-EOF
+ <ul class="translation-list">
+ $(awk -F: '{
+ "url-for " $2 | getline url
+ printf " <li><a href=\"%s\">%s</a></li>\n",
+ url, $1
+ }' "$FILENAME".i18n)
+ </ul>
+ EOF
+ )"
+ printf 'export translations_html="%s"\n' "$(shesc "$translations")"
+fi
+
if [ -n "${date:-}" ]; then
date_iso="$(date -ud "${date:?}" -Is)"
printf 'export date_iso="%s"\n' "$date_iso"
@@ -178,8 +192,8 @@ if [ -n "${update:-}" ]; then
fi
-url_part="$(printf '%s' "${FILENAME%.*}.html" | sed "s|^$CONTENT_PREFIX/||")"
-url="$(url-for "$url_part")"
+url="$(url-for "$FILENAME")"
+url_part="$(printf '%s' "$url" | sed 's|^/||')"
title_uri="$(uri "$title")"
printf 'export title_html="%s"\n' "$(printf '%s' "$title" | htmlesc | shesc)"