From e9751f6b180762d9e5a67c4b2a00155b56a708bf Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Mon, 30 Nov 2020 22:52:54 -0500 Subject: interesting posts, finished make post, fixed index --- Makefile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2f822c0..1571a60 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,24 @@ # 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 +.PHONY: serve post -serve: all +serve: 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 +post: @read -p "Title: " TITLE; \ read -p "Category: " CATEGORY; \ SHORT_DATE=`date +"%Y-%m-%d"`; \ - LONG_DATE=`date -R`; \ + LONG_DATE=`date +"%a, %d %b %Y"`; \ mkdir -p posts/$$CATEGORY; \ - FILENAME=posts/$$CATEGORY/`date +"%Y-%m-%d-"``echo $$TITLE | tr "[:upper:]" "[:lower:]" | tr "[:blank:]" -`.html; \ + FILENAME=posts/$$CATEGORY/$$SHORT_DATE-`echo $$TITLE | tr "[:upper:]" "[:lower:]" | tr "[:blank:]" -`.html; \ cp $(TEMPLATE) $$FILENAME; \ $$EDITOR $$FILENAME; \ + sed -i '' "s# # $$TITLE $$LONG_DATE https://www.53hor.net/$$FILENAME https://www.53hor.net/$$FILENAME \n #" rss.xml; \ + sed -i '' "s#