barf: MARKDOWN_OPTS added
This commit is contained in:
parent
1746b854d7
commit
1ba508485b
7
barf
7
barf
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
MARKDOWN=lowdown
|
MARKDOWN=lowdown
|
||||||
|
MARKDOWN_OPTS="--html-no-skiphtml --html-no-escapehtml"
|
||||||
IFS=' '
|
IFS=' '
|
||||||
|
|
||||||
# Create tab separated file with filename, title, creation date, last update
|
# Create tab separated file with filename, title, creation date, last update
|
||||||
@ -41,7 +42,7 @@ index_html() {
|
|||||||
sed "s/{{TITLE}}/$title/" header.html
|
sed "s/{{TITLE}}/$title/" header.html
|
||||||
|
|
||||||
# Intro text
|
# Intro text
|
||||||
$MARKDOWN index.md
|
$MARKDOWN $MARKDOWN_OPTS index.md
|
||||||
|
|
||||||
# Posts
|
# Posts
|
||||||
while read -r f title created; do
|
while read -r f title created; do
|
||||||
@ -73,7 +74,7 @@ EOF
|
|||||||
|
|
||||||
while read -r f title created; do
|
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|')
|
post_link=$(echo "$f" | sed -E 's|posts/(.*).md|\1|')
|
||||||
basic_date=$(echo $(head -3 "$f" | tail -1))
|
basic_date=$(echo $(head -3 "$f" | tail -1))
|
||||||
published_date=$(date -d $basic_date -u +%Y-%m-%dT10:%M:%SZ)
|
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))
|
created=$(echo $(head -3 "$filename" | tail -1))
|
||||||
title=$2
|
title=$2
|
||||||
|
|
||||||
$MARKDOWN "$filename" | \
|
$MARKDOWN $MARKDOWN_OPTS "$filename" | \
|
||||||
cat header.html - |\
|
cat header.html - |\
|
||||||
sed "s|{{TITLE}}|$title|" \
|
sed "s|{{TITLE}}|$title|" \
|
||||||
> "$target" && cat footer.html >> "$target"
|
> "$target" && cat footer.html >> "$target"
|
||||||
|
Loading…
Reference in New Issue
Block a user