From 484caec3ff5d9865ebc4e66711ef86e6bcbb094f Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Wed, 21 Apr 2021 23:37:19 -0400 Subject: automated RSS generation --- Makefile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index afa9a7e..8df6ceb 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,15 @@ # Written for FreeBSD make(1), or pmake. Not tested with GNU make. +EDITOR = $$EDITOR POST_T = templates/template.html -INDEX_HEAD_T = templates/index_foot.html -INDEX_FOOT_T = templates/index_head.html +INDEX_HEAD_T = templates/index_head.html +INDEX_FOOT_T = templates/index_foot.html +RSS_HEAD_T = templates/rss_head.xml +RSS_FOOT_T = templates/rss_foot.xml .PHONY: serve post clean -all: index.html +all: index.html rss.xml serve: python3.7 -m http.server 3000 @@ -15,17 +18,17 @@ post: @read -p "Title: " TITLE; \ read -p "Category: " CATEGORY; \ SHORT_DATE=`date +"%Y-%m-%d"`; \ - LONG_DATE=`date +"%a, %d %b %Y"`; \ mkdir -p posts/$$CATEGORY; \ FILENAME=posts/$$CATEGORY/$$SHORT_DATE-`printf "$$TITLE" | tr -Cs "[:alnum:]" '-' | tr "[:upper:]" "[:lower:]"`.html; \ cp $(POST_T) $$FILENAME; \ sed -i '' "s/{{ title }}/$$TITLE/g" $$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#