summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2020-11-30 22:52:54 -0500
committerAdam T. Carpenter <atc@53hor.net>2020-11-30 22:52:54 -0500
commite9751f6b180762d9e5a67c4b2a00155b56a708bf (patch)
tree0b55e045a8838f7b11d1c93772a28c7101cc787a /Makefile
parent015c3a1d7cd0a1f68e70bf3e1254ec541ea16ae5 (diff)
download53hor-e9751f6b180762d9e5a67c4b2a00155b56a708bf.tar.xz
53hor-e9751f6b180762d9e5a67c4b2a00155b56a708bf.zip
interesting posts, finished make post, fixed index
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 7 insertions, 10 deletions
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#</channel> </rss>#<item> <title>$$TITLE</title> <pubDate>$$LONG_DATE</pubDate> <link>https://www.53hor.net/$$FILENAME</link> <guid>https://www.53hor.net/$$FILENAME</guid> </item>\n</channel> </rss>#" rss.xml; \
+ sed -i '' "s#<ul id=\"index\">#<ul id=\"index\">\n<li> <a href=\"/$$FILENAME\">$$TITLE <code>$$LONG_DATE</code> </a> </li>#" index.html