blog/makefile

42 lines
854 B
Makefile

# update style recipe and do some more code review
pd=pandoc
style=--css style.css
navbar='./templates/navbar.html'
# Builder directories
pageDir='./markdown/pages/'
postDir='./markdown/post/'
pages=$(wildcard './markdown/pages/'*md)
posts=$(wildcard markdown/post/*.md)
# Site directories
root='./tmp/'
sitePost=$(root)/post/
sitePage=$(root)/page/
.PHONY: posts pages
# Pattern matching things
$(sitePost)%.html: $(postDir)/%.md
$(pd) $< $(style) -s -o $@
$(sitePage)%.html: $(pageDir)/%.md
$(pd) $< $(style) -s -o $@
# Builder recipes for getting through all posts/pages
posts: $(posts:.md=.html)
pages: $(pages:.md=.html)
# xd
index: index.md
$(pd) index.md $(style) -s -o $(root)/index.html
# Injecting navbar into the index
sed -i '7r $(navbar)' $(root)/index.html
# neocites makes me login anyway
upload:
neocities push _site/