From bfaccc32571df8a02f69518d8864244efba3b5b5 Mon Sep 17 00:00:00 2001 From: 53hornet Date: Wed, 28 Jul 2021 10:58:58 -0400 Subject: php site, templating and partials, faster index generation --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f7acbd1..8dcd6e5 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,17 @@ # Written for FreeBSD make(1), or pmake. Not tested with GNU make. EDITOR = $$EDITOR -POST_T = templates/template.html +POST_T = includes/template.php .PHONY: serve post serve: - python3.7 -m http.server 3000 + php -S localhost:8000 -post: - @read -p "Title: " TITLE; \ +draft: + @read -rp "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; \ + FILENAME=drafts/$$SHORT_DATE-`printf "$$TITLE" | tr -Cs "[:alnum:]" '-' | tr "[:upper:]" "[:lower:]"`.php; \ sed -i '' "s/{{ title }}/$$TITLE/g" $$FILENAME; \ $$EDITOR $$FILENAME + -- cgit v1.2.3