A small Makefile-based static site generator
A minimal publishing workflow that combines Markdown, m4, shared headers and footers, and Makefile dependency rules.
Store markdown formatted index.mdwn files in a directory hierarchy. Store the style.css, header.inc & footer.inc in the base directory with the following Makefile:
INFILES = $(shell find . -name "*.mdwn")
OUTFILES = $(INFILES:.mdwn=.html)
all: $(OUTFILES)
%.html: %.mdwn footer.inc header.inc style.css
m4 -PEIinc header.inc > $@
markdown $< >> $@
cat footer.inc >> $@
clean:
rm -f $(OUTFILES)
PHONY: all clean
Now simply run make to generate your site.