diff --git a/Makefile b/Makefile index 85db6a1..161b757 100644 --- a/Makefile +++ b/Makefile @@ -8,27 +8,14 @@ getparts = $(patsubst %.md,public_html/%.html.part,$(1)) .PHONY: all all: public_html/index.html $(call getpages,$(shell pandoc lua pandoc/links.lua --follow index.md)) -public_html/%.html: %.md - $(eval links := $(shell pandoc lua pandoc/links.lua $<)) +.SECONDEXPANSION: +public_html/%.html: %.md $$(shell pandoc lua pandoc/links.lua %.md) + $(eval links := $(filter-out $<,$^)) $(if $(links),$(MAKE) $(call getparts,$(links))) - pandoc \ - --data-dir pandoc \ - --defaults bavbavhaus.net.yaml \ - --template bavbavhaus.net.html5 \ - --metadata url=$*.html \ - $(patsubst %,--metadata links=%,$(call getparts,$(links))) \ - --output $@ \ - $< + pandoc --data-dir pandoc -d bavbavhaus.net.yaml --template bavbavhaus.net.html5 -M url=$*.html $(patsubst %,-M links=%,$(call getparts,$(links))) -o $@ $< public_html/%.html.part: %.md - pandoc \ - --data-dir pandoc \ - --defaults bavbavhaus.net.yaml \ - --template bavbavhaus.net.inline.html5 \ - --id-prefix $* \ - --metadata url=$*.html \ - --output $@ \ - $< + pandoc --data-dir pandoc -d bavbavhaus.net.yaml --template bavbavhaus.net.inline.html5 -M url=$*.html --id-prefix $* -o $@ $< .PHONY: clean clean: