Compare commits
3 Commits
674fd4c52a
...
e853c8baab
Author | SHA1 | Date |
---|---|---|
urosm | e853c8baab | |
urosm | 63f7c3a56a | |
urosm | 01564dc885 |
27
Makefile
27
Makefile
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue