summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-04-21 23:37:19 -0400
committerAdam T. Carpenter <atc@53hor.net>2021-04-21 23:37:19 -0400
commit484caec3ff5d9865ebc4e66711ef86e6bcbb094f (patch)
tree9bdd4db43f1de9eb94a060f58b755aaf621ad0f5
parent947868e661e05216b5555f6e6393b1003bc1245b (diff)
download53hor-484caec3ff5d9865ebc4e66711ef86e6bcbb094f.tar.xz
53hor-484caec3ff5d9865ebc4e66711ef86e6bcbb094f.zip
automated RSS generation
-rw-r--r--Makefile21
-rw-r--r--includes/icons/floppy-variant.svg2
-rw-r--r--rss.xml159
-rw-r--r--templates/rss_foot.xml3
-rw-r--r--templates/rss_head.xml13
5 files changed, 56 insertions, 142 deletions
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#</channel>#<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.xml; \
- sed -i '' "s#<ul id=\"index\">#<ul id=\"index\">\n<li> <a href=\"/$$FILENAME\">$$TITLE <code>$$LONG_DATE</code> </a> </li>#" index.html
+ $EDITOR $$FILENAME
index.html: posts/*.html
- @grep h1 $> | sort -r | sed 's#^\(posts/\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\)[^:]*\):[ \t]*<h1>\(.*\)</h1>#<li><a href="/\1">\3 <code>\2</code></a></li>#' | cat $(INDEX_FOOT_T) - $(INDEX_HEAD_T) > index.html
+ @grep h1 $> | sort -r | sed 's#^\(posts/\([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\)[^:]*\):[ \t]*<h1>\(.*\)</h1>#<li><a href="/\1">\3 <code>\2</code></a></li>#' | cat $(INDEX_HEAD_T) - $(INDEX_FOOT_T) > index.html
+
+rss.xml: posts/*.html
+ @grep h1 $> | sort -r | sed 's#^\(posts/[^:]*\):[ \t]*<h1>\(.*\)</h1>#<item><title>\2</title><link>https://www.53hor.net/posts/\1</link></item>#' | cat $(RSS_HEAD_T) - $(RSS_FOOT_T) > rss.xml
clean:
- rm index.html
+ rm -f index.html rss.xml
diff --git a/includes/icons/floppy-variant.svg b/includes/icons/floppy-variant.svg
index ff53cf7..96cc704 100644
--- a/includes/icons/floppy-variant.svg
+++ b/includes/icons/floppy-variant.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
- <path fill="#000000" d="M3,3V21H21V3H3M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,15A1,1 0 0,1 13,16V19A1,1 0 0,1 12,20A1,1 0 0,1 11,19V16A1,1 0 0,1 12,15Z" />
+ <path fill="#ffffff" d="M3,3V21H21V3H3M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,15A1,1 0 0,1 13,16V19A1,1 0 0,1 12,20A1,1 0 0,1 11,19V16A1,1 0 0,1 12,15Z" />
</svg>
diff --git a/rss.xml b/rss.xml
index 976bdfa..a363659 100644
--- a/rss.xml
+++ b/rss.xml
@@ -4,143 +4,38 @@
<channel>
<title>53hornet's Feed</title>
<link>https://www.53hor.net</link>
- <atom:link href="https://www.53hor.net/rss.xml" rel="self" type="appitemcation/rss+xml" />
+ <atom:link href="https://www.53hor.net/rss.xml" rel="self" type="application/rss+xml" />
<description>The World Wide Web pages of Adam Carpenter</description>
<image>
<url>https://www.53hor.net/includes/logo_diag.png</url>
<title>53hornet's Feed</title>
<link>https://www.53hor.net</link>
</image>
- <item>
- <title>Welcometh!</title>
- <link>https://www.53hor.net</link>
- <guid>https://www.53hor.net</guid>
- <description>ho! thanketh thee f'r subscribing to mine own rss feedeth</description>
- </item>
- <item>
- <title>Now This is a Minimal Install!</title>
- <pubDate>Sun, 26 Jul 2020 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/unix/2020-07-26-now-this-is-a-minimal-install.html</link>
- <guid>https://www.53hor.net/posts/unix/2020-07-26-now-this-is-a-minimal-install.html</guid>
- </item>
- <item>
- <title>Why Computer Science at William and Mary?</title>
- <pubDate>Sat, 11 Jul 2020 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/programming/2020-07-11-why-computer-science-at-w-m.html</link>
- <guid>https://www.53hor.net/posts/programming/2020-07-11-why-computer-science-at-w-m.html</guid>
- </item>
- <item>
- <title>Obligatory COVID-19 Post</title>
- <pubDate>Fri, 10 Apr 2020 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/life/2020-04-10-the-obligatory-covid-19-post.html</link>
- <guid>https://www.53hor.net/posts/life/2020-04-10-the-obligatory-covid-19-post.html</guid>
- </item>
- <item>
- <title>Wedding Photos Are Here!</title>
- <pubDate>Fri, 10 Apr 2020 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/life/2020-04-10-wedding-photos-are-here.html</link>
- <guid>https://www.53hor.net/posts/life/2020-04-10-wedding-photos-are-here.html</guid>
- </item>
- <item>
- <title>This is How I Do Data Recovery</title>
- <pubDate>Sat, 28 Sep 2019 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/unix/2019-09-28-my-preferred-method-for-data-recovery.html</link>
- <guid>https://www.53hor.net/posts/unix/2019-09-28-my-preferred-method-for-data-recovery.html</guid>
- </item>
- <item>
- <title>Right Lane Is For Passing, Not Cruising</title>
- <pubDate>Fri, 30 Aug 2019 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/wheels/2019-08-30-keep-right-except-to-pass.html</link>
- <guid>https://www.53hor.net/posts/wheels/2019-08-30-keep-right-except-to-pass.html</guid>
- </item>
- <item>
- <title>I Married My Best Friend!</title>
- <pubDate>Sun, 11 Aug 2019 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/life/2019-08-11-marrying-my-best-friend.html</link>
- <guid>https://www.53hor.net/posts/life/2019-08-11-marrying-my-best-friend.html</guid>
- </item>
- <item>
- <title>I Finally Found a Drink I Like</title>
- <pubDate>Sun, 28 Jul 2019 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/life/2019-07-28-i-finally-found-a-drink-i-like.html</link>
- <guid>https://www.53hor.net/posts/life/2019-07-28-i-finally-found-a-drink-i-like.html</guid>
- </item>
- <item>
- <title>Dancing the Shag and The [New] Lion King</title>
- <pubDate>Sun, 21 Jul 2019 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/life/2019-07-21-dancing-the-shag-and-the-new-lion-king.html</link>
- <guid>https://www.53hor.net/posts/life/2019-07-21-dancing-the-shag-and-the-new-lion-king.html</guid>
- </item>
- <item>
- <title>YABS: Yet Another Bad Shop</title>
- <pubDate>Thu, 04 Jul 2019 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/wheels/2019-07-04-yabs-yet-another-bad-shop.html</link>
- <guid>https://www.53hor.net/posts/wheels/2019-07-04-yabs-yet-another-bad-shop.html</guid>
- </item>
- <item>
- <title>Offloading GoPro Footage the Easy Way</title>
- <pubDate>Thu, 04 Jul 2019 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/unix/2019-07-04-the-best-way-to-transfer-gopro-files-with-linux.html</link>
- <guid>https://www.53hor.net/posts/unix/2019-07-04-the-best-way-to-transfer-gopro-files-with-linux.html</guid>
- </item>
- <item>
- <title>How to Start and Drive a Hudson Hornet</title>
- <pubDate>Fri, 07 Jun 2019 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/wheels/2019-06-07-how-to-start-and-drive-a-hudson-hornet.html</link>
- <guid>https://www.53hor.net/posts/wheels/2019-06-07-how-to-start-and-drive-a-hudson-hornet.html</guid>
- </item>
- <item>
- <title>Why Have a Web Site in 2019?</title>
- <pubDate>Sat, 06 Apr 2019 00:00:00 -0500</pubDate>
- <link>https://www.53hor.net/posts/computing/2019-04-06-why-have-a-website-in-2019.html</link>
- <guid>https://www.53hor.net/posts/computing/2019-04-06-why-have-a-website-in-2019.html</guid>
- </item>
- <item>
- <title>Titanic's Last Signals</title>
- <pubDate>Mon, 30 Nov 2020</pubDate>
- <link>https://www.53hor.net/posts/interesting/2020-11-30-titanic's-last-signals.html</link>
- <guid>https://www.53hor.net/posts/interesting/2020-11-30-titanic's-last-signals.html</guid>
- </item>
- <item>
- <title>The Guides</title>
- <pubDate>Tue, 01 Dec 2020</pubDate>
- <link>https://www.53hor.net/posts/programming/2020-12-01-the-guides.html</link>
- <guid>https://www.53hor.net/posts/programming/2020-12-01-the-guides.html</guid>
- </item>
- <item>
- <title>AOC 2020 Day 1 in CBM Basic</title>
- <pubDate>Fri, 04 Dec 2020</pubDate>
- <link>https://www.53hor.net/posts/programming/2020-12-04-aoc-2020-day-1-in-cbm-basic.html</link>
- <guid>https://www.53hor.net/posts/programming/2020-12-04-aoc-2020-day-1-in-cbm-basic.html</guid>
- </item>
- <item>
- <title>Useful Sprint Planning from a Certified Scrum Master</title>
- <pubDate>Tue, 08 Dec 2020</pubDate>
- <link>https://www.53hor.net/posts/programming/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.html</link>
- <guid>https://www.53hor.net/posts/programming/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.html</guid>
- </item>
- <item>
- <title>Why Does Everyone Use Adobe Acrobat [Reader]?</title>
- <pubDate>Tue, 22 Dec 2020</pubDate>
- <link>https://www.53hor.net/posts/computing/2020-12-22-why-does-everyone-use-adobe-acrobat-reader.html</link>
- <guid>https://www.53hor.net/posts/computing/2020-12-22-why-does-everyone-use-adobe-acrobat-reader.html</guid>
- </item>
- <item>
- <title>Antivirus Software is a Hack</title>
- <pubDate>Tue, 29 Dec 2020</pubDate>
- <link>https://www.53hor.net/posts/computing/2020-12-29-antivirus-software-is-a-hack.html</link>
- <guid>https://www.53hor.net/posts/computing/2020-12-29-antivirus-software-is-a-hack.html</guid>
- </item>
- <item>
- <title>Root on ZFS: A ZPool of Mirror VDEVs The Easy Way</title>
- <pubDate>Fri, 15 Jan 2021</pubDate>
- <link>https://www.53hor.net/posts/unix/2021-01-15-root-on-zfs-a-zpool-of-mirror-vdevs-the-easy-way.html</link>
- <guid>https://www.53hor.net/posts/unix/2021-01-15-root-on-zfs-a-zpool-of-mirror-vdevs-the-easy-way.html</guid>
- </item>
- <item> <title>Adam's 2020 Reading List</title> <pubDate>Fri, 15 Jan 2021</pubDate> <link>https://www.53hor.net/posts/life/2021-01-15-adam-s-2020-reading-list.html</link> <guid>https://www.53hor.net/posts/life/2021-01-15-adam-s-2020-reading-list.html</guid> </item>
-<item> <title>Undefined? JavaSript Is Undefined.</title> <pubDate>Thu, 28 Jan 2021</pubDate> <link>https://www.53hor.net/posts/programming/2021-01-28-undefined-javasript-is-undefined-.html</link> <guid>https://www.53hor.net/posts/programming/2021-01-28-undefined-javasript-is-undefined-.html</guid> </item>
-<item> <title>Louis Vierne Is a BAMF (and Proof That Organists Are Metal)</title> <pubDate>Fri, 12 Feb 2021</pubDate> <link>https://www.53hor.net/posts/life/2021-02-12-louis-vierne-is-a-bamf-and-proof-that-organists-are-metal-.html</link> <guid>https://www.53hor.net/posts/life/2021-02-12-louis-vierne-is-a-bamf-and-proof-that-organists-are-metal-.html</guid> </item>
-<item> <title>How to Automate Certbot Renewal with HAProxy</title> <pubDate>Fri, 19 Mar 2021</pubDate> <link>https://www.53hor.net/posts/unix/2021-03-19-how-to-automate-certbot-renewal-with-haproxy.html</link> <guid>https://www.53hor.net/posts/unix/2021-03-19-how-to-automate-certbot-renewal-with-haproxy.html</guid> </item>
-<item> <title>How to Make Your Website Boring and Why!</title> <pubDate>Tue, 20 Apr 2021</pubDate> <link>https://www.53hor.net/posts/computing/2021-04-20-how-to-make-your-website-boring-and-why-.html</link> <guid>https://www.53hor.net/posts/computing/2021-04-20-how-to-make-your-website-boring-and-why-.html</guid> </item>
+<item><title>How to Make Your Website Boring and Why!</title><link>https://www.53hor.net/posts/posts/2021-04-20-how-to-make-your-website-boring-and-why.html</link></item>
+<item><title>How to Automate Certbot Renewal with HAProxy</title><link>https://www.53hor.net/posts/posts/2021-03-19-how-to-automate-certbot-renewal-with-haproxy.html</link></item>
+<item><title>Louis Vierne Is a BAMF (and Proof That Organists Are Metal)</title><link>https://www.53hor.net/posts/posts/2021-02-12-louis-vierne-is-a-bamf-and-proof-that-organists-are-metal.html</link></item>
+<item><title>Undefined? JavaSript Is Undefined.</title><link>https://www.53hor.net/posts/posts/2021-01-28-undefined-javasript-is-undefined.html</link></item>
+<item><title>Root on ZFS: A ZPool of Mirror VDEVs</title><link>https://www.53hor.net/posts/posts/2021-01-15-root-on-zfs-a-zpool-of-mirror-vdevs-the-easy-way.html</link></item>
+<item><title>Adam's <del>2020</del> <ins>Quarantine</ins> Reading List</title><link>https://www.53hor.net/posts/posts/2021-01-15-adam-s-2020-reading-list.html</link></item>
+<item><title>Antivirus Software is a Hack</title><link>https://www.53hor.net/posts/posts/2020-12-29-antivirus-software-is-a-hack.html</link></item>
+<item><title>Why Does Everyone Use Adobe Acrobat [Reader]?</title><link>https://www.53hor.net/posts/posts/2020-12-22-why-does-everyone-use-adobe-acrobat-reader.html</link></item>
+<item><title>Useful Sprint Planning from a Certified Scrum Master</title><link>https://www.53hor.net/posts/posts/2020-12-08-useful-sprint-planning-from-a-certified-scrum-master.html</link></item>
+<item><title>AOC 2020 Day 1 in CBM Basic</title><link>https://www.53hor.net/posts/posts/2020-12-04-aoc-2020-day-1-in-cbm-basic.html</link></item>
+<item><title>𝔗𝔥𝔢 𝔊𝔲𝔦𝔡𝔢𝔰</title><link>https://www.53hor.net/posts/posts/2020-12-01-the-guides.html</link></item>
+<item><title>Titanic's Last Signals</title><link>https://www.53hor.net/posts/posts/2020-11-30-titanics-last-signals.html</link></item>
+<item><title>Now This is a Minimal Install!</title><link>https://www.53hor.net/posts/posts/2020-07-26-now-this-is-a-minimal-install.html</link></item>
+<item><title>Why Computer Science at William and Mary</title><link>https://www.53hor.net/posts/posts/2020-07-11-why-computer-science-at-w-m.html</link></item>
+<item><title>Wedding Photo Debacle</title><link>https://www.53hor.net/posts/posts/2020-04-10-wedding-photos-are-here.html</link></item>
+<item><title>Obligatory COVID-19 Post</title><link>https://www.53hor.net/posts/posts/2020-04-10-the-obligatory-covid-19-post.html</link></item>
+<item><title>How I Do Data Recovery</title><link>https://www.53hor.net/posts/posts/2019-09-28-my-preferred-method-for-data-recovery.html</link></item>
+<item><title>Left Lane is for Passing, Not Cruising</title><link>https://www.53hor.net/posts/posts/2019-08-30-keep-right-except-to-pass.html</link></item>
+<item><title>I Married My Best Friend!</title><link>https://www.53hor.net/posts/posts/2019-08-11-marrying-my-best-friend.html</link></item>
+<item><title>Finally Found a Drink I Like</title><link>https://www.53hor.net/posts/posts/2019-07-28-i-finally-found-a-drink-i-like.html</link></item>
+<item><title>Dancing the Shag & Two Left Feet</title><link>https://www.53hor.net/posts/posts/2019-07-21-dancing-the-shag-and-the-new-lion-king.html</link></item>
+<item><title>YABS: Yet Another Bad Shop</title><link>https://www.53hor.net/posts/posts/2019-07-04-yabs-yet-another-bad-shop.html</link></item>
+<item><title>Offloading GoPro Footage the Easy Way!</title><link>https://www.53hor.net/posts/posts/2019-07-04-the-best-way-to-transfer-gopro-files-with-linux.html</link></item>
+<item><title>How to Start and Drive a Hudson Hornet</title><link>https://www.53hor.net/posts/posts/2019-06-07-how-to-start-and-drive-a-hudson-hornet.html</link></item>
+<item><title>Why Have a Web Site in 2019?</title><link>https://www.53hor.net/posts/posts/2019-04-06-why-have-a-website-in-2019.html</link></item>
</channel>
</rss>
+
diff --git a/templates/rss_foot.xml b/templates/rss_foot.xml
new file mode 100644
index 0000000..5c185ae
--- /dev/null
+++ b/templates/rss_foot.xml
@@ -0,0 +1,3 @@
+</channel>
+</rss>
+
diff --git a/templates/rss_head.xml b/templates/rss_head.xml
new file mode 100644
index 0000000..286ac21
--- /dev/null
+++ b/templates/rss_head.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE xml>
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>53hornet's Feed</title>
+ <link>https://www.53hor.net</link>
+ <atom:link href="https://www.53hor.net/rss.xml" rel="self" type="application/rss+xml" />
+ <description>The World Wide Web pages of Adam Carpenter</description>
+ <image>
+ <url>https://www.53hor.net/includes/logo_diag.png</url>
+ <title>53hornet's Feed</title>
+ <link>https://www.53hor.net</link>
+ </image>