markdowns index.html
[thefekete.net.git] / Makefile
index 9e69204..54734c1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,12 @@
 # markdown sources
 posts=$(patsubst %.md,build/%.html,$(wildcard blog/*.md))
 # static sources
-S=index.html img/
+S=img/
 
-all: blog $S $(posts)
+all: build/index.html blog $S
        cp -av $S build/
 
-blog: build/blog/
+blog: build/blog/ $(posts)
 
 build/:
        mkdir -p $@
@@ -14,7 +14,12 @@ build/:
 build/blog/: build/
        mkdir -p $@
 
-build/blog/%.html: blog/%.md build/
+build/index.html: index.md build/ inc/head.template inc/foot.template
+       sed "s/__TITLE__/thefekete.net/; /__DATE__/d" inc/head.template >$@
+       markdown index.md >>$@
+       cat inc/foot.template >>$@
+
+build/blog/%.html: blog/%.md build/ inc/head.template inc/foot.template
        @# `pacman -S discount` for `markdown`
        bin/blog.awk $< >$@