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 ++--- includes/icons/floppy-variant.svg | 2 +- rss.xml | 159 +++++++------------------------------- templates/rss_foot.xml | 3 + templates/rss_head.xml | 13 ++++ 5 files changed, 56 insertions(+), 142 deletions(-) create mode 100644 templates/rss_foot.xml create mode 100644 templates/rss_head.xml 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#