This is what I use for my blog, it is 250 lines: https://gist.github.com/jes/88e3e587413d5794f69c281bdd14a27f
(Joking aside: cool project, and I expect it is substantially more capable than my ridiculously-hacky version).
~/www/blog/ $ ./recentblogposts.pl; ls -v 2020-*.html | tac | xargs cat > blog-2020.html
It does however depend on a few libs and comes with separate html template files for a theme so I am not exactly sure where I stand on the golf course.
for filename in ./posts/*.md; do
pandoc -s -c style.css $filename -o outputs/$(basename $filename md)html
That said, I do think this is the way to go, using a popular and generic tool (notably that you do not have to maintain) to accomplish a specific task. And more importantly, composing utilities together in a succinct and efficient way.
Also, if you used semicolons, or xargs with a pipe, you could make this one line :) newlines can be pretty arbitrary, I wonder if there's a better measurement for simplicity, like branches or statements/expressions.
pangeadoc -c style.css ./ -O ./_site
Mine is about 140 lines of bash, and I don't /think/ i'm using anything that isn't part of coreutils.
Aside from that, this approach is very similar to Marijn Haverbeke's (the CodeMirror author) generator, although your 60 lines does lean more heavily on third-party packages.
for filename in pages_md/*.md; do
basename=$(basename "$filename" .md)
pandoc "$filename" -f markdown_github -t html -o "pages/$basename.html"
It also means you have a completely decoupled backup system should anything go wrong with the primary.
I'm aiming to have at least one redundant component for every piece in the system I'm writing.
I do think this is one of the most enjoyable projects I’ve ever done.
I wrote about it here -> https://ajaxdavis.com/post/Introducing-JSON-Blog/
I'm using the project to run my blog above.
Static generator + CMS (extremely lightweight), management interface and markdown editing.
It has been that way for me. After trying many frameworks, "modern" languages, working on many teams, I've learned to love Perl, LCD-JS, and HTML in a whole new way.
(Textpattern was pretty great. Taught me about the weird google searches that lead people to your site.)
There are hacks in that file. Beware the dragons.
Commenting support is or course done with FastComments...
I expected it to write the blog, with GPT-3.