aboutsummaryrefslogtreecommitdiff
path: root/v2/src/bin/extract
diff options
context:
space:
mode:
Diffstat (limited to 'v2/src/bin/extract')
-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' \