title | css | content-class |
---|---|---|
A dumb markdown website |
well |
This is just a little hack I stumbled across to throw together a blindly simple set of nicely formatted HTML pages on a server quickly and easily.
Apache's mod_ext_filter
allows you to pass the content of files on your filesystem through arbitrary binaries - this just sets that up to run the great pandoc
utility on markdown files.
- Pandoc installed to
/usr/bin/pandoc
- I've only tested
install.sh
on Debian-based systems sofar - Apache setup with the
a2enmod
anda2enconf
utilities available
Run install.sh
(or read it and apply manually) and then pop the following into your .htaccess
or vhost file:
<IfModule mod_ext_filter.c>
AddOutputFilter pandoc md
</IfModule>
or alternatively, this (if you have no non-markdown files and don't want file-extensions):
<IfModule mod_ext_filter.c>
SetOutputFilter pandoc
</IfModule>
See Pandoc's docs for it's Markdown support.
The template also supports various variables in a YAML block (as seen at the top of this README.md
file) - you can get a full overview of the variables supported by reading the pandoc-template.html
file.
There's no caching - running pandoc
on every page request is probably a terrible idea.