summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-10-15 13:49:50 +0200
committerJonas Smedegaard <dr@jones.dk>2015-10-15 13:49:59 +0200
commit2661aa442277ac86ad51ea9250c3c26ffb07f22c (patch)
tree391560a3847776b3b53bc609f5c6e7a6e6fa91f9
parentca1cf5d34ca466d627edac79608f802d8afe921d (diff)
Install non-index file as index file in subdir (for nicer URLs).
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index a4365e7..0199a0b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
markdown := $(wildcard *.mdwn)
-hypertext = $(markdown:%.mdwn=%.html)
+hypertext = $(subst index/index,index,$(markdown:%.mdwn=%/index.html))
all: $(hypertext)
-%.html: %.mdwn
+%.html %/index.html: %.mdwn
+ $(if $(filter-out ./,$(dir $@)),mkdir -p $(dir $@))
pandoc -f markdown -t html -o $@ $<
clean:
- rm -f *.html
+ find -type f -name '*.html' -delete
+ find -type d -empty -delete
.PHONY: all clean