> use some shell magic to cat a header and footer to each page.
$ tree .
.
├── footer.html
├── header.html
├── Makefile
└── posts
├── a.body
├── b.body
└── c.body
$ cat Makefile
BODYFILES=$(shell find posts -type f -name "*.body")
POSTS=$(BODYFILES:.body=.html)
dist/slug.tar.gz: index.html $(POSTS)
mkdir -p dist && tar -czf $@ $^
index.body: $(POSTS)
python3 -c "import sys; [print('<a href="%s">%s<a/>' % (x, x[:-5])) for x in sorted(sys.argv[1:])]" $^ > $@
%.html: header.html %.body footer.html
cat $^ > $@
clean:
rm -rf $(POSTS) index.body index.html dist
.PHONY: clean