diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6a26510 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +# simple date to RFC date: +# date -j -f "%Y-%m-%d" -R 2020-10-29 + +all: + echo done. + +serve: + python3.7 -m http.server 3000 + +resume: + echo unimplemented! + +post: + @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; \ + $$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 + |