aboutsummaryrefslogtreecommitdiff
path: root/v2/src/development/getconf.sh
diff options
context:
space:
mode:
Diffstat (limited to 'v2/src/development/getconf.sh')
-rwxr-xr-xv2/src/development/getconf.sh21
1 files changed, 15 insertions, 6 deletions
diff --git a/v2/src/development/getconf.sh b/v2/src/development/getconf.sh
index 4b615a8..aa90706 100755
--- a/v2/src/development/getconf.sh
+++ b/v2/src/development/getconf.sh
@@ -99,23 +99,32 @@ escape() {
# shellcheck source=/dev/null
. src/lib/base."$lang".conf
- title="${title:-"$site_name"}"
+ if [ -z "${title:-}" ]; then
+ title="${site_name:?}"
+ printf 'title="%s"\n' "$(printf '%s' "$title" | escape)"
+ fi
+
+ if [ -z "${date:-}" ]; then
+ printf 'date_formatted="%s"\n' "$(LANG="$lang" date -d "${date:?}" +"${date_fmt:?}" | escape)"
+ fi
+
url_part="$(printf '%s' "${FILENAME%.md}.html" | sed 's|^src/content/||')"
- printf 'title="%s"\n' "$(printf '%s' "$title" | escape)"
printf 'title_html="%s"\n' "$(printf '%s' "$title" | htmlesc | escape)"
printf 'filename="%s"\n' "$FILENAME"
printf 'url_part="%s"\n' "$url_part"
printf 'url="%s"\n' "$(url-for "$url_part" | absolute)"
- printf 'date_formatted="%s"\n' "$(LANG="$lang" date -d "${date:?}" +"${date_fmt:?}" | escape)"
printf 'mailto_uri="%s%s"\n' "${mailto_uri_prefix:?}" "$(uri "$title")"
printf 'discussions_url="%s%s"\n' "${discussions_url_prefix:?}" "$(uri "$title")"
printf 'sourcecode_url="%s%s"\n' "${sourcecode_url_prefix:?}" "$FILENAME"
- printf 'lang_url="%s"\n' "$(url-for "$lang"/)"
+ printf 'style_url="%s"\n' "$(url-for -g 'style.css')"
+ printf 'favicon_url="%s"\n' "$(url-for -g 'favicon.svg')"
- printf 'style_url="%s"\n' "$(url-for 'style.css')"
- printf 'favicon_url="%s"\n' "$(url-for 'favicon.svg')"
+ # FIXME: special treatment of root
+ printf 'homepage_url="%s"\n' "$(url-for '/')"
+
+ printf 'about_url="%s"\n' "$(url-for "${about_url_name:?}")"
rm -f "$FILENAME".tmp
} | grep . | sed 's|^|export |'