From 505a94190f4aba9404b7c9d95444bfa0a14925ec Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Mon, 20 Apr 2020 00:07:56 -0400 Subject: [PATCH] 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 @@ - - - - -
-

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/ 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.

    +
    ') + +') diff --git a/guix.scm b/guix.scm deleted file mode 100644 index c1e02d9..0000000 --- a/guix.scm +++ /dev/null @@ -1,73 +0,0 @@ -;;; bandali's personal site, using haunt-next (git) -;;; Copyright © 2019 Amin Bandali -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see . - -;; To set up a hacking environment: -;; guix environment -l guix.scm - -(use-modules (guix packages) - (guix licenses) - (guix git-download) - (guix build-system gnu) - (guix utils) ; substitute-keyword-arguments - (gnu packages autotools) - (gnu packages base) ; glibc-locales - (gnu packages guile) - (gnu packages guile-xyz)) - -(define haunt-next - (package - (inherit haunt) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://git.dthompson.us/haunt.git") - (commit "65adbb052f7d27c382b7f9f3c665635aeab96a02"))) - (sha256 - (base32 - "19vybz0hczjxj3npznnams5740vqi1gsdsyjiqpy241f783f4i83")))) - (arguments - (substitute-keyword-arguments (package-arguments haunt) - ((#:phases phases) - `(modify-phases ,phases - (add-before 'configure 'bootstrap - (lambda _ - (zero? (system* "./bootstrap")))))))) - (native-inputs - `(("autoconf" ,autoconf) ; autoreconf - ("automake" ,automake) ; aclocal - ,@(package-native-inputs haunt))) - (propagated-inputs - `(("glibc-locales" ,glibc-locales) ; setlocale-related runtime error - ,@(package-propagated-inputs haunt))))) - -(package - (name "bandali-site") - (version "git") - (source #f) - (build-system gnu-build-system) - (synopsis #f) - (description #f) - (license gpl3+) - (home-page "https://bandali.eu.org") - (inputs - `(("guile" ,guile-2.2))) - (native-inputs - `(("haunt" ,haunt-next) - ("guile-reader" ,guile-reader) - ("guile-sjson" ,guile-sjson) - ("guile-commonmark" ,guile-commonmark) - ("guile-syntax-highlight" ,guile-syntax-highlight)))) diff --git a/haunt.scm b/haunt.scm deleted file mode 100644 index 414ef08..0000000 --- a/haunt.scm +++ /dev/null @@ -1,54 +0,0 @@ -;;; Copyright © 2019 Amin Bandali -;;; -;;; This program is free software; you can redistribute it and/or -;;; modify it under the terms of the GNU General Public License as -;;; published by the Free Software Foundation; either version 3 of the -;;; License, or (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see -;;; . - -(use-modules (bandali feeds) - (bandali pages) - (bandali prefs) - (bandali tags) - (bandali theme) - (haunt builder blog) - (haunt builder assets) - (haunt post) - (haunt reader commonmark) - (haunt site)) - -(site #:title "Amin Bandali" - #:scheme my-scheme ; requires haunt-next - #:domain my-domain - #:default-metadata - '((author . "Amin Bandali") - (email . "bandali@gnu.org") - (domain . my-domain)) - #:readers (list commonmark-reader) - #:builders (list (blog #:theme bandali-theme - #:collections - `(("Notes" "notes.html" - ,posts/reverse-chronological))) - (tag-pages) - index-page - (atom-feed - #:file-name "notes.atom") - (atom-feeds-by-tag - #:prefix my-tag-prefix) - (rss-feed - #:file-name "notes.rss") - (rss-feeds-by-tag - #:prefix my-tag-prefix) - contact-page - cv-page - license-page - se212-f19-page - (static-directory "static" ""))) diff --git a/header.html b/header.html new file mode 100644 index 0000000..e371576 --- /dev/null +++ b/header.html @@ -0,0 +1,46 @@ +ifdef(`__feed', +` +Amin Bandali +tag:bandali.eu.org,2016:__slug +__pub +__upd + +__title +', +` + + + + + +__title`'ifdef(`__nts',,` — Amin Bandali') + + + + +ifdef(`__pub', +`ifdef(`__first',,`')' +`ifdef(`__last',,`')') + + +
    +ifelse(__slug,`home',`

    __title

    ', +`Amin Bandali's Personal Site') +
    + +
    +ifdef(`__pub', +`
    +
    +

    __title

    +

    Published on syscmd(date "-d __pub" "+%B %e`,' %Y")`'ifdef(`__upd',`
    +Last updated on syscmd(date "-d __upd" "+%B %e`,' %Y")')

    +
    ')') diff --git a/index.html b/index.m4 similarity index 94% rename from index.html rename to index.m4 index a1f7823..54fe7a2 100644 --- a/index.html +++ b/index.m4 @@ -1,6 +1,8 @@ - - - +dnl -*- html -*- +define(__title, `Amin Bandali''`s Personal Site')dnl +define(__slug, `home')dnl +define(__nts)dnl +include(header.html)

    Hi, I'm Amin. I am currently a graduate student at the Waterloo Formal Methods @@ -123,5 +125,5 @@ and

    - - +define(__copy, `2016–2019')dnl +include(footer.html) diff --git a/license.html b/license.m4 similarity index 83% rename from license.html rename to license.m4 index d9df1b6..1cf8818 100644 --- a/license.html +++ b/license.m4 @@ -1,5 +1,7 @@ - - +dnl -*- html -*- +define(__title, `Licensing Information')dnl +define(__slug, `license')dnl +include(header.html) - - +define(__copy, `2019')dnl +include(footer.html) diff --git a/ssi/license.html b/ssi/license.html deleted file mode 100644 index 9bdecfa..0000000 --- a/ssi/license.html +++ /dev/null @@ -1,5 +0,0 @@ -
    -

    Copyright © Amin Bandali. -See the above for license conditionslicense conditions. -Please copy and share.

    -
    diff --git a/ssi/post.html b/ssi/post.html deleted file mode 100644 index 08e9c1b..0000000 --- a/ssi/post.html +++ /dev/null @@ -1,4 +0,0 @@ -
    - - - diff --git a/ssi/postn.html b/ssi/postn.html deleted file mode 100644 index 71ed959..0000000 --- a/ssi/postn.html +++ /dev/null @@ -1,5 +0,0 @@ -

    Got a question or comment? You can find my -email address on my contact page. -:-)

    - - diff --git a/ssi/pre.html b/ssi/pre.html deleted file mode 100644 index 49e2780..0000000 --- a/ssi/pre.html +++ /dev/null @@ -1,16 +0,0 @@ - -
    -

    - -Amin Bandali's Personal Site -
    - -
    diff --git a/ssi/pren.html b/ssi/pren.html deleted file mode 100644 index 71e1004..0000000 --- a/ssi/pren.html +++ /dev/null @@ -1,7 +0,0 @@ - -
    -
    -

    -

    Published on
    -Last updated on

    -
    diff --git a/ssi/pre0.html b/static/404.html similarity index 59% rename from ssi/pre0.html rename to static/404.html index cac6873..26f3f81 100644 --- a/ssi/pre0.html +++ b/static/404.html @@ -3,8 +3,15 @@ -<!--# echo var="title" --><!--# if expr="$nts" --><!--# else --> — Amin Bandali<!--# endif --> +404 Not Found + +
    +

    404

    +

    Sorry, that page does not exist.

    +
    + + diff --git a/bandali-pubkey.txt b/static/bandali-pubkey.txt similarity index 100% rename from bandali-pubkey.txt rename to static/bandali-pubkey.txt diff --git a/feed.svg b/static/feed.svg similarity index 100% rename from feed.svg rename to static/feed.svg diff --git a/gnu.ico b/static/gnu.ico similarity index 100% rename from gnu.ico rename to static/gnu.ico diff --git a/gpl-3.0.html b/static/gpl-3.0.html similarity index 100% rename from gpl-3.0.html rename to static/gpl-3.0.html diff --git a/icon-12px.png b/static/icon-12px.png similarity index 100% rename from icon-12px.png rename to static/icon-12px.png diff --git a/icon-16px.png b/static/icon-16px.png similarity index 100% rename from icon-16px.png rename to static/icon-16px.png diff --git a/se212-f19/se212-h02q04d-soln.grg b/static/se212-f19/se212-h02q04d-soln.grg similarity index 100% rename from se212-f19/se212-h02q04d-soln.grg rename to static/se212-f19/se212-h02q04d-soln.grg diff --git a/se212-f19/se212-t01.html b/static/se212-f19/se212-t01.html similarity index 100% rename from se212-f19/se212-t01.html rename to static/se212-f19/se212-t01.html diff --git a/se212-f19/se212-t01.org b/static/se212-f19/se212-t01.org similarity index 100% rename from se212-f19/se212-t01.org rename to static/se212-f19/se212-t01.org diff --git a/se212-f19/se212-t05.org b/static/se212-f19/se212-t05.org similarity index 100% rename from se212-f19/se212-t05.org rename to static/se212-f19/se212-t05.org diff --git a/style.css b/static/style.css similarity index 100% rename from style.css rename to static/style.css -- 2.20.1