for POST in *.md; do pandoc --to=html5 --output=$(basename ${POST%.md}).html --standalone $POST; done
The $(basename ${POST%.md}).html strips out the .md file extension, and also removes the directory path (helpful if your posts are stored in a folder). I found this stackoverflow question a helpful guide.
I'd also recommend eleventy as a no nonsense static site generator.
Excellent post! Here's the oneliner bash loop ;)
The
$(basename ${POST%.md}).html
strips out the .md file extension, and also removes the directory path (helpful if your posts are stored in a folder). I found this stackoverflow question a helpful guide.I'd also recommend eleventy as a no nonsense static site generator.
Not seen the
basename
trick before - very, very nice.