diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -1,24 +1,27 @@ -# simple date to RFC date: -# date -j -f "%Y-%m-%d" -R 2020-10-29 +# Written for FreeBSD make(1), or pmake. Not tested with GNU make. -all: - echo done. +TEMPLATE = templates/template.html +RSS_TEMPLATE = templates/rss.xml -serve: +.PHONY: all clean serve post + +serve: all python3.7 -m http.server 3000 -resume: - echo unimplemented! +clean: + rm -f index.html + rm -f rss.xml + +profile/adamcarpenter.pdf: profile/adamcarpenter.html + touch profile/adamcarpenter.pdf -post: +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; \ + mkdir -p posts/$$CATEGORY; \ + FILENAME=posts/$$CATEGORY/`date +"%Y-%m-%d-"``echo $$TITLE | tr "[:upper:]" "[:lower:]" | tr "[:blank:]" -`.html; \ + cp $(TEMPLATE) $$FILENAME; \ $$EDITOR $$FILENAME; \ - sed -i .bak '5 a\ - <item> <title>$$TITLE</title> <link>https://www.53hor.net/$$FILENAME</link> <guid>https://www.53hor.net/$$FILENAME</guid> <pubDate>$$LONG_DATE</pubDate> </item> - ' rss.xml |