# Written for FreeBSD make(1), or pmake. Not tested with GNU make. EDITOR = $$EDITOR POST_T = templates/template.html .PHONY: serve post serve: python3.7 -m http.server 3000 post: @read -p "Title: " TITLE; \ SHORT_DATE=`date +"%Y-%m-%d"`; \ FILENAME=posts/$$SHORT_DATE-`printf "$$TITLE" | tr -Cs "[:alnum:]" '-' | tr "[:upper:]" "[:lower:]"`.html; \ cp $(POST_T) $$FILENAME; \ sed -i '' "s/{{ title }}/$$TITLE/g" $$FILENAME; \ $$EDITOR $$FILENAME