diff options
author | EuAndreh <eu@euandre.org> | 2022-09-02 13:17:36 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-09-02 13:17:36 -0300 |
commit | 1716448358de81f4c9d970e7f2e57ac581717af2 (patch) | |
tree | f7bebfbd2a56889456151cd3f048946c300f17c1 /v2/src/development | |
parent | v2/src/development/genhtml.sh: Remove fake $(_ "...") translation support (diff) | |
download | euandre.org-1716448358de81f4c9d970e7f2e57ac581717af2.tar.gz euandre.org-1716448358de81f4c9d970e7f2e57ac581717af2.tar.xz |
v2/: Centralize all env vars in the generated *.entry-env file
Diffstat (limited to 'v2/src/development')
-rw-r--r-- | v2/src/development/config.env.in | 1 | ||||
-rwxr-xr-x | v2/src/development/genhtml.sh | 29 |
2 files changed, 3 insertions, 27 deletions
diff --git a/v2/src/development/config.env.in b/v2/src/development/config.env.in index 18d5367..ca2afe7 100644 --- a/v2/src/development/config.env.in +++ b/v2/src/development/config.env.in @@ -1,5 +1,6 @@ #!/bin/sh +SITE_NAME="EuAndreh's website" FQDN='@FQDN@' BASE_URL='@BASE_URL@' DATE_FMT='+%B %-d, %Y' diff --git a/v2/src/development/genhtml.sh b/v2/src/development/genhtml.sh index bcac28c..e4c6d1a 100755 --- a/v2/src/development/genhtml.sh +++ b/v2/src/development/genhtml.sh @@ -85,6 +85,8 @@ shift $((OPTIND - 1)) FILENAME="${1:-}" eval "$(assert-arg "$FILENAME" 'FILENAME')" +. "${FILENAME%.md}.entry-env" + # # Utility functions @@ -218,33 +220,6 @@ emit_body() { } -# -# Environment variables -# - -. src/development/config.env - -eval "$( - awk ' - /^---$/ { if (++separator > 1) exit; else next; } - { print } - ' "$FILENAME" -)" - -SITE_NAME="EuAndreh's website" -TITLE="${TITLE:-$SITE_NAME}" -URI_TITLE="$(printf '%s' "$TITLE" | uri)" -URL="$(printf '%s' "$FILENAME" | sed -e 's|^src/content/||' -e 's|md$|html|')" - -PREAMBLE="$( - cat <<-EOF - # $TITLE - - <p class="timestamp"> - Posted on <time datetime="$DATE">$(LANG="$LANGUAGE" date -d "$DATE" "$DATE_FMT")</time> - </p> - EOF -)" |