better makefile, still not done but getting closer

This commit is contained in:
Medium Fries 2019-03-11 13:34:45 -07:00
parent 0fb87c2955
commit 9e3cdb5f8f

41
makefile Normal file
View File

@ -0,0 +1,41 @@
# 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/