From 2661aa442277ac86ad51ea9250c3c26ffb07f22c Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 15 Oct 2015 13:49:50 +0200 Subject: Install non-index file as index file in subdir (for nicer URLs). --- Makefile | 8 +++++--- 1 file 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 -- cgit v1.2.3