fix remaining issues with non-numeric slugs
authorAmin Bandali <bandali@gnu.org>
Tue, 21 Apr 2020 01:42:38 +0000 (21:42 -0400)
committerAmin Bandali <bandali@gnu.org>
Tue, 21 Apr 2020 01:42:38 +0000 (21:42 -0400)
13 files changed:
Makefile
arch-macbook-air.m4
computing.m4
contact.m4
cv.m4
feed_atom.m4
feed_rss.m4
footer.html
header.html
index.m4
license.m4
meta_notes.m4 [new file with mode: 0644]
se212-f19.m4

index a41b020..4fb327f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,12 @@
-LATEST=2
-SRC := $(filter-out $(wildcard feed_*),$(wildcard *.m4))
+SRC := $(filter-out $(wildcard feed_*) meta_notes.m4,$(wildcard *.m4))
 OUTPUTS := $(patsubst %.m4,out/%.html,$(SRC))
 STATIC := $(patsubst static/%,out/%,$(wildcard 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/notes.atom: feed_atom.m4 ; m4 -D__latest=$(LATEST) $< > $@
-out/notes.rss: feed_rss.m4 ; m4 -D__latest=$(LATEST) $< > $@
+out/%.html: %.m4 header.html footer.html ; m4 $< > $@
+out/notes.atom: feed_atom.m4 ; m4 $< > $@
+out/notes.rss: feed_rss.m4 ; m4 $< > $@
 $(STATIC): ; ln -s $(PWD)/static/$(notdir $@) $@
 
 deploy:
index 4d2a348..4435a94 100644 (file)
@@ -1,10 +1,10 @@
 dnl -*- html -*-
+define(__title, `Arch GNU/Linux on MacBook Air 2013')dnl
 define(__pub, 2016-11-01T12:00:00Z)dnl
 define(__upd, 2020-03-27T12:00:00Z)dnl
-define(__title, `Arch GNU/Linux on MacBook Air 2013')dnl
-define(__slug, `computing')dnl
 define(__id, 1)dnl
-include(header.html)
+include(header.html)dnl
+
 <p>This post summarizes how I install and dual-boot Arch GNU/Linux
 with Full-Disk Encryption alongside macOS.  It is not meant to be a
 replacement for the
@@ -272,5 +272,6 @@ bits and pieces, about installing Arch on a MacBook:</p>
 <li><a href="//medium.com/phils-thought-bubble-of-recent-stuff/arch-linux-running-on-my-macbook-2ea525ebefe3">Arch Linux running on my MacBook</a></li>
 <li><a href="http://codylittlewood.com/arch-linux-on-macbook-pro-installation/">Dual boot Arch Linux on MacBook Pro Installation</a></li>
 </ul>
+
 define(__copy, `2016, 2019, 2020')dnl
-include(footer.html)
+include(footer.html)dnl
index e15e2aa..d9f1c6e 100644 (file)
@@ -1,10 +1,10 @@
 dnl -*- html -*-
+define(__title, `How I do my Computing')dnl
 define(__pub, 2019-09-14T12:00:00Z)dnl
 define(__upd, 2019-11-30T23:00:00Z)dnl
-define(__title, `How I do my Computing')dnl
-define(__slug, `computing')dnl
 define(__id, 2)dnl
-include(header.html)
+include(header.html)dnl
+
 <p>(Inspired by computing pages of
 <a href="//stallman.org/stallman-computing.html">rms</a> and
 <a href="//blog.vimuser.org/leah-computing.html">Leah Rowe</a>)</p>
@@ -47,5 +47,6 @@ for functioning.  I can't wait for lxo's
 <a href="//www.fsfla.org/ikiwiki/blogs/lxo/pub/0G">0G</a> to become a
 reality fast enough.
 <span class="smly">:-)</span></p>
+
 define(__copy, `2019')dnl
-include(footer.html)
+include(footer.html)dnl
index a56f36f..8e5f192 100644 (file)
@@ -1,7 +1,8 @@
 dnl -*- html -*-
 define(__title, `Contact Information')dnl
 define(__slug, `contact')dnl
-include(header.html)
+include(header.html)dnl
+
 <article>
 <h1>Contact information</h1>
 <p>Email is by far my preferred method of communication.  I may be
@@ -62,4 +63,5 @@ necessary.</p>
 <li><del><a href="//twitter.com/notbandali">notbandali</a> on Twitter</del></li>
 </ul>
 </article>
-include(footer.html)
+
+include(footer.html)dnl
diff --git a/cv.m4 b/cv.m4
index c92cca3..8a7bf94 100644 (file)
--- a/cv.m4
+++ b/cv.m4
@@ -1,8 +1,8 @@
 dnl -*- html -*-
 define(__title, `Curriculum vitae')dnl
 define(__slug, `cv')dnl
-include(header.html)
-<main>
+include(header.html)dnl
+
 <h1>Curriculum vitae (<a href="//p.bndl.org/bandali-cv.pdf">PDF</a>)</h1>
 
 <table>
@@ -62,4 +62,5 @@ Department, York University | Fall 2017</h3>
 <p>Teaching Assistant</p>
 <p><abbr title="Net-Centric Introduction to Computing">EECS 1012</abbr>:
 TA in Fall 2017</p>
-include(footer.html)
+
+include(footer.html)dnl
index 8cbffc0..f0c9a46 100644 (file)
@@ -1,3 +1,4 @@
+include(meta_notes.m4)dnl
 <?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>
@@ -9,5 +10,5 @@ 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)')
+  syscmd(sed "s/\&/\&amp;/g;s/>/\&gt;/g;s/</\&lt;/g" _get(`notes', __i).m4 | m4 -D__feed_atom)')
 </feed>
index 6830453..8ebecd8 100644 (file)
@@ -1,3 +1,4 @@
+include(meta_notes.m4)dnl
 <?xml version="1.0" encoding="UTF-8" ?>
 <rss version="2.0">
 <channel>
@@ -11,6 +12,6 @@ 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)')
+  syscmd(sed "s/\&/\&amp;/g;s/>/\&gt;/g;s/</\&lt;/g" _get(`notes', __i).m4 | m4 -D__feed_rss)')
 </channel>
 </rss>
index 34f9250..098115d 100644 (file)
@@ -1,10 +1,11 @@
 ifdef(`__feed_atom', `</content></entry>',
-`ifdef(`__feed_rss',`</description></item>',
+`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.
 <span class="smly">:-)</span></p>
-</article>')
+</article>
+')dnl
 </main>
 ifdef(`__copy',
 `<footer>
@@ -13,4 +14,4 @@ See the ifelse(__slug,`license',`above for license conditions',`<a href="/licens
 Please copy and share.</p>
 </footer>')
 </body>
-</html>')')
+</html>')')dnl
index 9c73747..78e73d6 100644 (file)
@@ -1,3 +1,5 @@
+include(meta_notes.m4)dnl
+ifdef(`__slug',,`define(__slug, _get(`notes', __id))')dnl
 ifdef(`__feed_atom',
 `<entry xml:base="https://bandali.eu.org">
 <author><name>Amin Bandali</name></author>
@@ -26,8 +28,10 @@ ifdef(`__feed_atom',
 <link rel="stylesheet" href="/style.css"/>
 <link rel="index" href="/"/>
 ifdef(`__pub',
-`ifdef(`__first',,`<link rel="prev" href="/decr(__id)">')'
-`ifdef(`__last',,`<link rel="next" href="/incr(__id)">')')
+define(__previd, `_get(`notes', decr(__id))')dnl
+define(__nextid, `_get(`notes', incr(__id))')dnl
+`ifelse(__previd,,,`<link rel="prev" href="/__previd">')'dnl
+`ifelse(__nextid,,,`<link rel="next" href="/__nextid">')')dnl
 </head>
 <body>
 <header>
@@ -50,4 +54,4 @@ ifdef(`__pub',
 <h1>__title</h1>
 <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>')')')
+</header>')')')dnl
index 9fdad21..509d850 100644 (file)
--- a/index.m4
+++ b/index.m4
@@ -2,7 +2,8 @@ dnl -*- html -*-
 define(__title, `Amin Bandali''`s Personal Site')dnl
 define(__slug, `home')dnl
 define(__nts)dnl
-include(header.html)
+include(header.html)dnl
+
 <section id="intro">
 <p>Hi, I'm Amin.  I am currently a graduate student at the
 <a href="//watform.uwaterloo.ca">Waterloo Formal Methods</a>
@@ -125,5 +126,6 @@ and
 </tbody>
 </table>
 </section>
+
 define(__copy, `2016&ndash;2019')dnl
-include(footer.html)
+include(footer.html)dnl
index 1cf8818..35e5912 100644 (file)
@@ -1,7 +1,8 @@
 dnl -*- html -*-
 define(__title, `Licensing Information')dnl
 define(__slug, `license')dnl
-include(header.html)
+include(header.html)dnl
+
 <article>
 <h1>License information for bandali.eu.org</h1>
 <p>I strongly believe in
@@ -22,5 +23,6 @@ later version.  A copy of the license is included at
 <li><a href="//www.gnu.org/proprietary/proprietary.html">Proprietary Software Is Often Malware</a></li>
 </ul>
 </article>
+
 define(__copy, `2019')dnl
-include(footer.html)
+include(footer.html)dnl
diff --git a/meta_notes.m4 b/meta_notes.m4
new file mode 100644 (file)
index 0000000..f5a6e17
--- /dev/null
@@ -0,0 +1,5 @@
+define(`__latest', 2)dnl
+define(`_put', `define(`$1[$2]', `$3')')dnl
+define(`_get', `defn(`$1[$2]')')dnl
+_put(`notes', 1, `arch-macbook-air')dnl
+_put(`notes', 2, `computing')dnl
index 3b1aeb9..8553aa6 100644 (file)
@@ -1,7 +1,8 @@
 dnl -*- html -*-
 define(__title, `SE 212 Material')dnl
 define(__slug, `se212-f19')dnl
-include(header.html)
+include(header.html)dnl
+
 <article>
 <h1>Material from SE 212 tutorials</h1>
 <p>This page contains slides and other material from
@@ -40,4 +41,5 @@ solution</a></li>
 <li>Tutorial 10: worked through questions 1–10 of Homework 10</li>
 </ul>
 </article>
-include(footer.html)
+
+include(footer.html)dnl