SRCS := $(shell find content pages -name '*.md')
HTML := $(SRCS:content/%.md=%.html)
HTML := $(HTML:pages/%.md=%.html)
vpath %.md content pages
vpath %.html dist

%.html: %.md
	pandoc -t html \
		--standalone \
		-B templates/nav.html \
		--template=templates/episode.template \
		--css assets/styles/main.css \
		--toc \
		-o dist/$@ $<

index.md:
	./bin/build-index.sh

rssfeed:
	./bin/build-podcast.sh

build: $(HTML) index.md rssfeed
	cp -R assets dist
	pandoc -t html \
		--standalone \
		-H templates/header.html \
		-B templates/nav.html \
		-o dist/index.html \
		--css assets/styles/main.css \
		index.md app.yaml
