summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/fmt-code2
-rw-r--r--include/footer.gsp (renamed from include/footer.html)10
-rw-r--r--include/head.gsp5
-rw-r--r--include/head.html5
-rw-r--r--include/lib.m417
-rw-r--r--include/nav.gsp4
-rw-r--r--include/nav.html4
7 files changed, 31 insertions, 16 deletions
diff --git a/include/fmt-code b/include/fmt-code
index 9da3828..c02a389 100755
--- a/include/fmt-code
+++ b/include/fmt-code
@@ -1,3 +1,3 @@
#!/bin/sh
-sed 's|.*|<code>&</code>|' "${2%/*}/$1"
+sed 's|.*|>code{-&}|; $s/>//' "${2%/*}/$1"
diff --git a/include/footer.html b/include/footer.gsp
index 6b45a2c..f613fcf 100644
--- a/include/footer.html
+++ b/include/footer.gsp
@@ -1,14 +1,14 @@
m4_define(⁨m4___id__⁩, m4_esyscmd(git rev-list -1 HEAD m4___caller__))
-<small>
+small {-
Page last edited:
- <a
+ @a
href="https://git.thomasvoss.com/www.thomasvoss.com/commit?id=m4___id__"
target="_blank"
- >
+ {-
m4_esyscmd(
git log -1 --pretty='format:%cI' m4___caller__ \
| ifne xargs date +'%A %d %B %Y — %T %Z' -d \
| ifne -n echo 'No commit yet…'
)
- </a>
-</small>
+ }
+}
diff --git a/include/head.gsp b/include/head.gsp
new file mode 100644
index 0000000..407589a
--- /dev/null
+++ b/include/head.gsp
@@ -0,0 +1,5 @@
+meta charset="UTF-8" {}
+meta name="viewport" content="width=device-width, initial-scale=1.0" {}
+link href="/favicon.svg" rel="shortcut icon" type="image/svg" {}
+link href="/style.css" rel="stylesheet" {}
+title {-The Mango Tree}
diff --git a/include/head.html b/include/head.html
deleted file mode 100644
index 97aa283..0000000
--- a/include/head.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<meta charset="UTF-8">
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<link href="/favicon.svg" rel="shortcut icon" type="image/svg">
-<link href="/style.css" rel="stylesheet">
-<title>The Mango Tree</title>
diff --git a/include/lib.m4 b/include/lib.m4
index 34cf2c3..3d0e50f 100644
--- a/include/lib.m4
+++ b/include/lib.m4
@@ -2,12 +2,27 @@ m4_dnl To avoid annoying conflicts with quote characters, use
m4_dnl U+2068 FIRST STRONG ISOLATE and U+2069 POP DIRECTIONAL ISOLATE
m4_changequote(⁨,⁩)
+m4_dnl We also need to avoid the comment character ever doing absolutely
+m4_dnl anything. I don’t think I’ll ever use ASCII character 1 (SOH) lol.
+m4_changecom()
+
+m4_dnl Macro to create a page footer
m4_define(
m4_footer,
- ⁨m4_define(⁨m4___caller__⁩, m4___file__)m4_include(footer.html)⁩
+ ⁨m4_define(⁨m4___caller__⁩, m4___file__)m4_include(footer.gsp)⁩
)
+m4_dnl Macro to properly format code blocks
m4_define(
m4_fmt_code,
⁨m4_esyscmd(fmt-code "$1" m4___file__)m4_dnl⁩
)
+
+m4_dnl Macro to escape characters in gsp(5) text-nodes
+m4_define(
+ m4_gsp_quote,
+ ⁨m4_patsubst(⁨$1⁩, ⁨[@}\\]⁩, ⁨\\\&⁩)⁩
+)
+
+m4_dnl Macro for generating abbrevations
+m4_define(m4_abbr, ⁨@abbr .m4_translit($1, A-Z2, a-zt) {-$1}⁩)
diff --git a/include/nav.gsp b/include/nav.gsp
new file mode 100644
index 0000000..93a7ae5
--- /dev/null
+++ b/include/nav.gsp
@@ -0,0 +1,4 @@
+menu {
+ li {a href="/" {-Home}}
+ li {a href=".." {-Back}}
+}
diff --git a/include/nav.html b/include/nav.html
deleted file mode 100644
index 9f8f2c2..0000000
--- a/include/nav.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<menu>
- <li><a href="/">Home</a></li>
- <li><a href="..">Back</a></li>
-</menu>