aboutsummaryrefslogtreecommitdiff
path: root/v2/src/bin/extract
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/bin/extract
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 '')
-rwxr-xr-xv2/src/bin/extract22
1 files changed, 22 insertions, 0 deletions
diff --git a/v2/src/bin/extract b/v2/src/bin/extract
index 4380be7..a086264 100755
--- a/v2/src/bin/extract
+++ b/v2/src/bin/extract
@@ -87,6 +87,7 @@ case "$TYPE" in
' "$FILENAME"
;;
env)
+ cat src/development/config.env
awk '
/^---$/ {
if (++separator > 1) {
@@ -99,6 +100,27 @@ case "$TYPE" in
{ print }
' "$FILENAME"
printf "FILENAME='%s'\n" "$FILENAME"
+ cat <<-'REAL_EOF'
+ 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
+ )"
+ REAL_EOF
;;
*)
printf 'Bad value for TYPE: "%s".\n\n' \