aboutsummaryrefslogtreecommitdiff
path: root/v2/src/development
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-09-02 13:17:36 -0300
committerEuAndreh <eu@euandre.org>2022-09-02 13:17:36 -0300
commit1716448358de81f4c9d970e7f2e57ac581717af2 (patch)
treef7bebfbd2a56889456151cd3f048946c300f17c1 /v2/src/development
parentv2/src/development/genhtml.sh: Remove fake $(_ "...") translation support (diff)
downloadeuandre.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.in1
-rwxr-xr-xv2/src/development/genhtml.sh29
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
-)"