Compare commits

...

3 Commits

Author SHA1 Message Date
urosm e853c8baab fixup! fixup! update `Makefile` 2024-05-02 23:53:43 +02:00
urosm 63f7c3a56a fixup! update `Makefile` 2024-05-02 21:47:26 +02:00
urosm 01564dc885 update `Makefile` 2024-05-02 21:43:58 +02:00
1 changed files with 6 additions and 21 deletions

View File

@ -5,33 +5,18 @@ SHELL = /bin/sh
getpages = $(patsubst %.md,public_html/%.html,$(1)) getpages = $(patsubst %.md,public_html/%.html,$(1))
getparts = $(patsubst %.md,public_html/%.html.part,$(1)) getparts = $(patsubst %.md,public_html/%.html.part,$(1))
all: $(call getpages,$(shell pandoc lua pandoc/links.lua --follow index.md))
.PHONY: all .PHONY: all
all: public_html/index.html $(call getpages,$(shell pandoc lua pandoc/links.lua --follow index.md))
public_html/%.html: %.md .SECONDEXPANSION:
$(eval links := $(shell pandoc lua pandoc/links.lua $<)) public_html/%.html: %.md $$(shell pandoc lua pandoc/links.lua %.md)
$(eval links := $(filter-out $<,$^))
$(if $(links),$(MAKE) $(call getparts,$(links))) $(if $(links),$(MAKE) $(call getparts,$(links)))
pandoc \ pandoc --data-dir pandoc -d bavbavhaus.net.yaml --template bavbavhaus.net.html5 -M url=$*.html $(patsubst %,-M links=%,$(call getparts,$(links))) -o $@ $<
--data-dir pandoc \
--defaults bavbavhaus.net.yaml \
--template bavbavhaus.net.html5 \
--metadata url=$*.html \
$(patsubst %,--metadata links=%,$(filter-out $<,$^)) \
--output $@ \
$<
public_html/%.html.part: %.md public_html/%.html.part: %.md
pandoc \ pandoc --data-dir pandoc -d bavbavhaus.net.yaml --template bavbavhaus.net.inline.html5 -M url=$*.html --id-prefix $* -o $@ $<
--data-dir pandoc \
--defaults bavbavhaus.net.yaml \
--template bavbavhaus.net.inline.html5 \
--id-prefix $* \
--metadata url=$*.html \
--output $@ \
$<
# clean all targets
.PHONY: clean .PHONY: clean
clean: clean:
$(RM) public_html/*.html.part $(RM) public_html/*.html.part