deal with the footer and metadata

This commit is contained in:
Lucy 2020-07-21 18:46:35 +02:00
parent 440e4fa753
commit 1c9652e1a9

View File

@ -69,14 +69,16 @@ $(pandoc $3 | sed '/<!--/d;s/^/ /')]]>
create_entry() {
path="$9"
outpath="$(basename "$path" .md).html"
# convert new markdown posts to html
pandoc -s --css=/css/sakura-vader.css --template=./pandoc-template-v2.2.1.html5 \
-V og-url="https://$outpath" \
src/meta/default.yaml "$path" src/footer/footer.md -t html5 -f markdown -o "dist/$outpath"
# then add it to the index
title=$(grep -h '<title>' "dist/$outpath" | sed 's/<title>//g;s/<\/title>//g')
created=$(grep -h '^date: ' "$path" | sed 's/date: //g')
created_date=$(date +'%b %d, %Y' --date="$created")
published_date=$(date --iso-8601=seconds --date="$created")
# convert new markdown posts to html
pandoc -s --css=/css/sakura-vader.css --template=./pandoc-template-v2.2.1.html5 \
-V og-url="https://$outpath" -V published-date="$published_date" \
-V include-footer="$footer" \
src/meta/default.yaml "$path" -t html5 -f markdown -o "dist/$outpath"
# then add it to the index
title=$(grep -h '<title>' "dist/$outpath" | sed 's/<title>//g;s/<\/title>//g')
html_entry "$outpath" "$created_date" "$title"
rss_entry "$title" "$outpath" $path $created
}
@ -84,7 +86,10 @@ create_entry() {
convert_static() {
path="$9"
outpath="$(basename "$path" .md).html"
pandoc -s --css=/css/sakura-vader.css "$path" src/footer/footer.md -t html5 -f markdown -o "dist/$outpath"
pandoc -s --css=/css/sakura-vader.css --template=./pandoc-template-v2.2.1.html5 "$path" \
-V include-footer="$footer" \
-t html5 -f markdown -o "dist/$outpath"
}
has_updates() {
@ -97,6 +102,7 @@ has_updates() {
fi
}
footer="$(cat src/footer/footer.html)"
cd /home/lucy/blog-content/
rm -R dist/*
rsync -q --delete -avxt static/ dist/
@ -104,4 +110,7 @@ add_header
ls -lr src/posts/*.md | tail -n+1 | while read f; do create_entry $f; done
ls -l src/*.md | tail -n+1 | while read f; do convert_static $f; done
add_footer
pandoc -s --css=/css/sakura-vader.css src/index/index_header.md dist/posts-table.html src/index/after-entry-list.md src/footer/footer.md -o dist/index.html
pandoc -s --css=/css/sakura-vader.css \
-V include-after="$footer" \
src/index/index_header.md dist/posts-table.html src/index/after-entry-list.md \
-t html5 -f markdown -o dist/index.html