summaryrefslogtreecommitdiff
path: root/Makefile
blob: 2f822c006e84ddfcb5c117fcf45d235580af84e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Written for FreeBSD make(1), or pmake. Not tested with GNU make.

TEMPLATE = templates/template.html
RSS_TEMPLATE = templates/rss.xml

.PHONY: all clean serve post 

serve: all
	python3.7 -m http.server 3000

clean:
	rm -f index.html
	rm -f rss.xml

profile/adamcarpenter.pdf: profile/adamcarpenter.html
	touch profile/adamcarpenter.pdf

post: clean
	@read -p "Title: " TITLE; \
	read -p "Category: " CATEGORY; \
	SHORT_DATE=`date +"%Y-%m-%d"`; \
	LONG_DATE=`date -R`; \
	mkdir -p posts/$$CATEGORY; \
	FILENAME=posts/$$CATEGORY/`date +"%Y-%m-%d-"``echo $$TITLE | tr "[:upper:]" "[:lower:]" | tr "[:blank:]" -`.html; \
	cp $(TEMPLATE) $$FILENAME; \
	$$EDITOR $$FILENAME; \