add rss feed
authorAmin Bandali <bandali@gnu.org>
Mon, 20 Apr 2020 05:48:07 +0000 (01:48 -0400)
committerAmin Bandali <bandali@gnu.org>
Mon, 20 Apr 2020 05:48:07 +0000 (01:48 -0400)
Makefile
feed.m4 [deleted file]
feed_atom.m4 [new file with mode: 0644]
feed_rss.m4 [new file with mode: 0644]
footer.html
header.html
index.m4

index ff5e216..b4e1909 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,15 @@
 RSYNC_PARAMS = --exclude-from='.rsync-exclude' -avzLP
 
 LATEST=2
-SRC := $(wildcard *.m4 | grep -v feed.m4)
+SRC := $(filter-out $(wildcard feed_*),$(wildcard *.m4))
 OUTPUTS := $(patsubst %.m4,out/%.html,$(SRC))
 STATIC := $(patsubst static/%,out/%,$(wildcard static/*))
 
-all: $(OUTPUTS) out/atom.xml out/style.css $(STATIC)
+all: $(OUTPUTS) out/notes.atom out/notes.rss out/style.css $(STATIC)
 
 out/%.html: %.m4 header.html footer.html ; m4 -D__latest=$(LATEST) $< > $@
-out/atom.xml: feed.m4 ; m4 -D__latest=$(LATEST) $< > $@
+out/notes.atom: feed_atom.m4 ; m4 -D__latest=$(LATEST) $< > $@
+out/notes.rss: feed_rss.m4 ; m4 -D__latest=$(LATEST) $< > $@
 $(STATIC): ; ln -s $(PWD)/static/$(notdir $@) $@
 
 deploy:
diff --git a/feed.m4 b/feed.m4
deleted file mode 100644 (file)
index 712a9b5..0000000
--- a/feed.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
-  <title>Amin Bandali's Personal Site</title>
-  <id>tag:bandali.eu.org,2016:notes/</id>
-  <link href="https://bandali.eu.org/atom.xml" rel="self" type="application/atom+xml"/>
-  <link href="https://bandali.eu.org" rel="alternate" type="text/html"/>
-  <updated>syscmd(date -Iseconds -u | tr -d \\n)</updated>
-define(__feed)dnl
-define(`fordown',`ifelse($#,0,``$0'',`ifelse(eval($2>=$3),1,
-  `pushdef(`$1',$2)$4`'popdef(`$1')$0(`$1',decr($2),$3,`$4')')')')
-fordown(`__i',__latest,eval(__latest-10),`
-  syscmd(sed "s/\&/\&amp;/g;s/>/\&gt;/g;s/</\&lt;/g" __i.m4 | m4 -D__feed)')
-</feed>
diff --git a/feed_atom.m4 b/feed_atom.m4
new file mode 100644 (file)
index 0000000..8cbffc0
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
+<title>Amin Bandali's Personal Site</title>
+<id>tag:bandali.eu.org,atom,notes/</id>
+<link href="https://bandali.eu.org/notes.atom" rel="self" type="application/atom+xml"/>
+<link href="https://bandali.eu.org" rel="alternate" type="text/html"/>
+<updated>syscmd(date -Iseconds -u | tr -d \\n)</updated>
+define(__feed_atom)dnl
+define(`fordown',`ifelse($#,0,``$0'',`ifelse(eval($2>=$3),1,
+  `pushdef(`$1',$2)$4`'popdef(`$1')$0(`$1',decr($2),$3,`$4')')')')
+fordown(`__i',__latest,eval(__latest-10),`
+  syscmd(sed "s/\&/\&amp;/g;s/>/\&gt;/g;s/</\&lt;/g" __i.m4 | m4 -D__feed_atom)')
+</feed>
diff --git a/feed_rss.m4 b/feed_rss.m4
new file mode 100644 (file)
index 0000000..6830453
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<rss version="2.0">
+<channel>
+<title>Amin Bandali's Personal Site</title>
+<description>Notes and blog posts by Amin Bandali</description>
+<link>https://bandali.eu.org</link>
+<lastBuildDate>syscmd(date -uR | tr -d \\n)</lastBuildDate>
+<pubDate>syscmd(date -uR | tr -d \\n)</pubDate>
+<ttl>1800</ttl>
+define(__feed_rss)dnl
+define(`fordown',`ifelse($#,0,``$0'',`ifelse(eval($2>=$3),1,
+  `pushdef(`$1',$2)$4`'popdef(`$1')$0(`$1',decr($2),$3,`$4')')')')
+fordown(`__i',__latest,eval(__latest-10),`
+  syscmd(sed "s/\&/\&amp;/g;s/>/\&gt;/g;s/</\&lt;/g" __i.m4 | m4 -D__feed_rss)')
+</channel>
+</rss>
index ae2825c..34f9250 100644 (file)
@@ -1,4 +1,5 @@
-ifdef(`__feed', `</content></entry>',
+ifdef(`__feed_atom', `</content></entry>',
+`ifdef(`__feed_rss',`</description></item>',
 `ifdef(`__pub',
 `<p class="muted inbox">Got a question or comment?  You can find my
 email address on my <a href="contact">contact</a> page.
@@ -12,4 +13,4 @@ See the ifelse(__slug,`license',`above for license conditions',`<a href="/licens
 Please copy and share.</p>
 </footer>')
 </body>
-</html>')
+</html>')')
index e371576..9c73747 100644 (file)
@@ -1,12 +1,19 @@
-ifdef(`__feed',
+ifdef(`__feed_atom',
 `<entry xml:base="https://bandali.eu.org">
 <author><name>Amin Bandali</name></author>
-<id>tag:bandali.eu.org,2016:__slug</id>
+<id>tag:bandali.eu.org,atom,notes:__slug</id>
 <published>__pub</published>
 <updated>__upd</updated>
 <link href="https://bandali.eu.org/__slug" rel="alternate" type="text/html"/>
 <title>__title</title>
 <content type="html">',
+`ifdef(`__feed_rss',
+`<item>
+<title>__title</title>
+<link>https://bandali.eu.org/__slug</link>
+<guid isPermaLink="false">tag:bandali.eu.org,rss,notes:__slug</guid>
+<pubDate>syscmd(date "-uRd __pub" | tr -d \\n)</pubDate>
+<description>',
 `<!doctype html>
 <html lang="en">
 <head>
@@ -41,6 +48,6 @@ ifdef(`__pub',
 `<article>
 <header>
 <h1>__title</h1>
-<p>Published on syscmd(date "-d __pub" "+%B %e`,' %Y")`'ifdef(`__upd',`<br/>
-Last updated on syscmd(date "-d __upd" "+%B %e`,' %Y")')</p>
-</header>')')
+<p>Published on syscmd(date "-d __pub" "+%B %e`,' %Y" | tr -d \\n)`'ifdef(`__upd',`<br/>
+Last updated on syscmd(date "-d __upd" "+%B %e`,' %Y" | tr -d \\n)')</p>
+</header>')')')
index 54fe7a2..0a23064 100644 (file)
--- a/index.m4
+++ b/index.m4
@@ -11,7 +11,8 @@ group at the University of Waterloo, supervised by
 The main goal of my research is
 improving <strong>software and systems reliability</strong>
 through application of
-<a href="//en.wikipedia.org/wiki/Formal_methods">formal methods</a>.</p>
+<a href="//en.wikipedia.org/wiki/Formal_methods">formal
+methods</a>.</p>
 
 <p>My research at WatForm focuses on formal logic, model checking, and
 verification.  I am also interested in programming languages, proof
@@ -101,15 +102,15 @@ York University, Toronto, Canada, August 15, 2017">poster</a>
 <section id="notes">
 <h2>Notes</h2>
 <p>Here are notes about a variety of topics and issues I care
-about.<!--<br/>
-They're also available via
+about.<br/>
+They are also available via
 <a href="notes.atom">
-<img class="feed-icon" src="/icon-12px.png"
-     alt="subscribe to atom feed">Atom</a>
+<img class="feed-icon" src="icon-12px.png"
+     alt="subscribe to Atom feed">Atom</a>
 and
 <a href="notes.rss">
-<img class="feed-icon" src="/icon-12px.png"
-     alt="subscribe to rss feed">RSS</a> feeds.--></p>
+<img class="feed-icon" src="icon-12px.png"
+     alt="subscribe to RSS feed">RSS</a> feeds.</p>
 
 <table class="post-list">
 <tbody>
@@ -117,7 +118,6 @@ and
 <td><a href="computing">How I do my Computing</a></td>
 <td><small>September 14, 2019</small></td>
 </tr>
-
 <tr>
 <td><a href="arch-macbook-air">Arch GNU/Linux on MacBook Air 2013</a></td>
 <td><small>November 1, 2016</small></td>