barf: MARKDOWN_OPTS added
This commit is contained in:
parent
1746b854d7
commit
1ba508485b
7
barf
7
barf
@ -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/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g')
|
||||
content=$($MARKDOWN $MARKDOWN_OPTS "$f" | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/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"
|
||||
|
Loading…
Reference in New Issue
Block a user