summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8dcd6e56a2da4939a0edc80ef470c0e6d3770b6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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