How I build my website

This website lives in the form of Markdown files in a Mercurial repository along with build instructions in a Makefile. To build, one simply runs make and the Markdown files are rendered and combined with a template using Pandoc into HTML. Then the files are simply served using the Nginx web server.

The Makefile in simplified form looks like this:

# Variables holding names of files of various types
MD   = $(shell hg files -I '**.md')
HTML = $(patsubst %.md,%.html,$(MD))

all: $(HTML)

# Main rule for turning markdown (and metadata) into HTML
%.html: %.md
    pandoc \
        -f markdown \
        -t html5 \
        --template=_template.html \
        --css=minimal.css \
        --standalone \
        --section-divs \
        -o "$@" "$<"
    chmod a+r "$@"

Simple, yes?