# Written for FreeBSD make(1), or pmake. Not tested with GNU make. EDITOR = $$EDITOR POST_T = includes/template.php .PHONY: serve post serve: php -S localhost:8000 draft: @read -rp "Title: " TITLE; \ SHORT_DATE=`date +"%Y-%m-%d"`; \ FILENAME=drafts/$$SHORT_DATE-`printf "$$TITLE" | tr -Cs "[:alnum:]" '-' | tr "[:upper:]" "[:lower:]"`.php; \ sed -i '' "s/{{ title }}/$$TITLE/g" $$FILENAME; \ $$EDITOR $$FILENAME