From 505a94190f4aba9404b7c9d95444bfa0a14925ec Mon Sep 17 00:00:00 2001
From: Amin Bandali
Date: Mon, 20 Apr 2020 00:07:56 -0400
Subject: [PATCH 1/1] port from an SSI-based setup to one using GNU M4
---
.gitignore | 2 +-
404.html | 8 --
Makefile | 16 ++--
arch-macbook-air.html => arch-macbook-air.m4 | 15 ++--
computing.html => computing.m4 | 15 ++--
contact.html => contact.m4 | 8 +-
cv.html => cv.m4 | 8 +-
feed.m4 | 13 ++++
footer.html | 15 ++++
guix.scm | 73 ------------------
haunt.scm | 54 -------------
header.html | 46 +++++++++++
index.html => index.m4 | 12 +--
license.html => license.m4 | 10 ++-
ssi/license.html | 5 --
ssi/post.html | 4 -
ssi/postn.html | 5 --
ssi/pre.html | 16 ----
ssi/pren.html | 7 --
ssi/pre0.html => static/404.html | 9 ++-
.../bandali-pubkey.txt | 0
feed.svg => static/feed.svg | 0
gnu.ico => static/gnu.ico | Bin
gpl-3.0.html => static/gpl-3.0.html | 0
icon-12px.png => static/icon-12px.png | Bin
icon-16px.png => static/icon-16px.png | Bin
.../se212-f19}/se212-h02q04d-soln.grg | 0
.../se212-f19}/se212-t01.html | 0
{se212-f19 => static/se212-f19}/se212-t01.org | 0
{se212-f19 => static/se212-f19}/se212-t05.org | 0
style.css => static/style.css | 0
31 files changed, 134 insertions(+), 207 deletions(-)
delete mode 100644 404.html
rename arch-macbook-air.html => arch-macbook-air.m4 (96%)
rename computing.html => computing.m4 (86%)
rename contact.html => contact.m4 (93%)
rename cv.html => cv.m4 (93%)
create mode 100644 feed.m4
create mode 100644 footer.html
delete mode 100644 guix.scm
delete mode 100644 haunt.scm
create mode 100644 header.html
rename index.html => index.m4 (94%)
rename license.html => license.m4 (83%)
delete mode 100644 ssi/license.html
delete mode 100644 ssi/post.html
delete mode 100644 ssi/postn.html
delete mode 100644 ssi/pre.html
delete mode 100644 ssi/pren.html
rename ssi/pre0.html => static/404.html (59%)
rename bandali-pubkey.txt => static/bandali-pubkey.txt (100%)
rename feed.svg => static/feed.svg (100%)
rename gnu.ico => static/gnu.ico (100%)
rename gpl-3.0.html => static/gpl-3.0.html (100%)
rename icon-12px.png => static/icon-12px.png (100%)
rename icon-16px.png => static/icon-16px.png (100%)
rename {se212-f19 => static/se212-f19}/se212-h02q04d-soln.grg (100%)
rename {se212-f19 => static/se212-f19}/se212-t01.html (100%)
rename {se212-f19 => static/se212-f19}/se212-t01.org (100%)
rename {se212-f19 => static/se212-f19}/se212-t05.org (100%)
rename style.css => static/style.css (100%)
diff --git a/.gitignore b/.gitignore
index 45ddf0a..89f9ac0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-site/
+out/
diff --git a/404.html b/404.html
deleted file mode 100644
index 33fab2f..0000000
--- a/404.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-bandali.eu.org
-
-404
-Sorry, that page does not exist.
-
diff --git a/Makefile b/Makefile
index 526ef66..ff5e216 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,17 @@
-SOURCE_DIR = $(CURDIR)/
+RSYNC_PARAMS = --exclude-from='.rsync-exclude' -avzLP
-RSYNC_PARAMS = --exclude-from='.rsync-exclude' --delete -avzP
+LATEST=2
+SRC := $(wildcard *.m4 | grep -v feed.m4)
+OUTPUTS := $(patsubst %.m4,out/%.html,$(SRC))
+STATIC := $(patsubst static/%,out/%,$(wildcard static/*))
-SSH_USER = abandali@bandali.eu.org
-SSH_DEST = www/
+all: $(OUTPUTS) out/atom.xml out/style.css $(STATIC)
-all: deploy
+out/%.html: %.m4 header.html footer.html ; m4 -D__latest=$(LATEST) $< > $@
+out/atom.xml: feed.m4 ; m4 -D__latest=$(LATEST) $< > $@
+$(STATIC): ; ln -s $(PWD)/static/$(notdir $@) $@
deploy:
- rsync $(RSYNC_PARAMS) $(SOURCE_DIR) $(SSH_USER):$(SSH_DEST)
+ rsync $(RSYNC_PARAMS) out/ abandali@bandali.eu.org:www/
.PHONY: deploy
diff --git a/arch-macbook-air.html b/arch-macbook-air.m4
similarity index 96%
rename from arch-macbook-air.html
rename to arch-macbook-air.m4
index 2a30027..4d2a348 100644
--- a/arch-macbook-air.html
+++ b/arch-macbook-air.m4
@@ -1,7 +1,10 @@
-
-
-
-
+dnl -*- html -*-
+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)
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
@@ -269,5 +272,5 @@ bits and pieces, about installing Arch on a MacBook:
Arch Linux running on my MacBook
Dual boot Arch Linux on MacBook Pro Installation
-
-
+define(__copy, `2016, 2019, 2020')dnl
+include(footer.html)
diff --git a/computing.html b/computing.m4
similarity index 86%
rename from computing.html
rename to computing.m4
index 357ec3e..e15e2aa 100644
--- a/computing.html
+++ b/computing.m4
@@ -1,7 +1,10 @@
-
-
-
-
+dnl -*- html -*-
+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)
(Inspired by computing pages of
rms and
Leah Rowe )
@@ -44,5 +47,5 @@ for functioning. I can't wait for lxo's
0G to become a
reality fast enough.
:-)
-
-
+define(__copy, `2019')dnl
+include(footer.html)
diff --git a/contact.html b/contact.m4
similarity index 93%
rename from contact.html
rename to contact.m4
index 0776021..a56f36f 100644
--- a/contact.html
+++ b/contact.m4
@@ -1,5 +1,7 @@
-
-
+dnl -*- html -*-
+define(__title, `Contact Information')dnl
+define(__slug, `contact')dnl
+include(header.html)
Contact information
Email is by far my preferred method of communication. I may be
@@ -60,4 +62,4 @@ necessary.
notbandali on Twitter
-
+include(footer.html)
diff --git a/cv.html b/cv.m4
similarity index 93%
rename from cv.html
rename to cv.m4
index c0ba44c..4a485f4 100644
--- a/cv.html
+++ b/cv.m4
@@ -1,5 +1,7 @@
-
-
+dnl -*- html -*-
+define(__title, `Curriculum vitae')dnl
+define(__slug, `cv')dnl
+include(header.html)
Curriculum vitae (PDF )
@@ -60,4 +62,4 @@ Department, York University | Fall 2017
Teaching Assistant
EECS 1012 :
TA in Fall 2017
-
+include(footer.html)
diff --git a/feed.m4 b/feed.m4
new file mode 100644
index 0000000..712a9b5
--- /dev/null
+++ b/feed.m4
@@ -0,0 +1,13 @@
+
+
+ Amin Bandali's Personal Site
+ tag:bandali.eu.org,2016:notes/
+
+
+ syscmd(date -Iseconds -u | tr -d \\n)
+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/\&/\&/g;s/>/\>/g;s/\</g" __i.m4 | m4 -D__feed)')
+
diff --git a/footer.html b/footer.html
new file mode 100644
index 0000000..ae2825c
--- /dev/null
+++ b/footer.html
@@ -0,0 +1,15 @@
+ifdef(`__feed', `',
+`ifdef(`__pub',
+`Got a question or comment? You can find my
+email address on my contact page.
+:-)
+')
+
+ifdef(`__copy',
+`
+Copyright © __copy Amin Bandali.
+See the ifelse(__slug,`license',`above for license conditions',`license conditions ').
+Please copy and share.
+ ')
+