Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For what it's worth, if you're using Pandoc, you can set the HTML output to be "standalone" based on a simple template.[0] You can also include a standard header and footer to be automatically inserted for each generated page.

    pandoc \
      --standalone \
      --css=/style.css \
      --highlight-style=code-highlight.theme \
      --variable=lang:en \
      --include-before-body=navbar.html \
      --include-after-body=footer.html \
      --template=template.html \
      $MD -o $HTML
I use a variation of this command in a bash script to generate my entire static site.[1] A friend improved upon my script with a Go implementation that does some more advanced stuff, but still compiles Markdown to HTML using this command under the hood.[2]

0: https://pandoc.org/MANUAL.html#option--standalone

1: https://github.com/jstrieb/personal-site/blob/master/compile...

2: https://github.com/lsnow99/dudu



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: