We use the awesomeness of Jekyll to generate this site. It makes it super easy to generate static pages from templates. Jekyll is a static site generator written in ruby that runs your files thru Markdown or Textile to split out static html pages. There are options available with Jekyll that allow you to configure the template engine, syntax highlighter, permalinks and pagination.
Some of the benefits of serving static html pages are: very little security concerns, speed, less maintenance (no db to maintain, backup, web server configuration etc), easier version control and ease of deployment.
Markdown trick:
In one of my Markdown template files I needed to add link to an image. The way to do this in Markdown syntax is:
[![Alt text][2]][1]
[1]: http://www.example.com/ "Example"
[2]: http://www.foo.com/includes/images/foo.jpeg
this will generate the needed html markup:
<a href="http://www.example.com/" title="Example">
<img src="http://www.foo.com/includes/images/foo.jpeg" alt="Alt text" /></a>