barf: MARKDOWN_OPTS added

This commit is contained in:
dogeystamp 2024-05-17 15:45:02 -04:00
parent 1746b854d7
commit 1ba508485b
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

7
barf
View File

@ -24,6 +24,7 @@
set -eu
MARKDOWN=lowdown
MARKDOWN_OPTS="--html-no-skiphtml --html-no-escapehtml"
IFS=' '
# Create tab separated file with filename, title, creation date, last update
@ -41,7 +42,7 @@ index_html() {
sed "s/{{TITLE}}/$title/" header.html
# Intro text
$MARKDOWN index.md
$MARKDOWN $MARKDOWN_OPTS index.md
# Posts
while read -r f title created; do
@ -73,7 +74,7 @@ EOF
while read -r f title created; do
content=$($MARKDOWN "$f" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g')
content=$($MARKDOWN $MARKDOWN_OPTS "$f" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g')
post_link=$(echo "$f" | sed -E 's|posts/(.*).md|\1|')
basic_date=$(echo $(head -3 "$f" | tail -1))
published_date=$(date -d $basic_date -u +%Y-%m-%dT10:%M:%SZ)
@ -101,7 +102,7 @@ write_page() {
created=$(echo $(head -3 "$filename" | tail -1))
title=$2
$MARKDOWN "$filename" | \
$MARKDOWN $MARKDOWN_OPTS "$filename" | \
cat header.html - |\
sed "s|{{TITLE}}|$title|" \
> "$target" && cat footer.html >> "$target"