commit 9560f470f3fa73d3118c34c3e13d6ca5315798f6
parent 73d4b8b9cd7777e6306aa7268d87dfc9c7575cb8
Author: regexghost <dev@regexghost.com>
Date: Thu, 9 Jul 2026 21:34:07 +0100
added header-ids.sh script, and fixes to templates (changed Pages to Posts for proper ordering)
Diffstat:
7 files changed, 31 insertions(+), 8 deletions(-)
diff --git a/about.md b/about.md
@@ -22,10 +22,15 @@ Alternatively you can open an issue on:
Available on [GitHub](https://github.com/regexghost),
[Codeberg](https://codeberg.org/regexghost) and my [self-hosted git
-server](https://git.randomcoder.com)
+server](https://git.regexghost.com)
## This Website
This website is written in markdown, all of the content can be found on [my GitHub](https://github.com/regexghost) (and alternatives). It is compiled into HTML using [gozer](https://github.com/dannyvankooten/gozer) ([my
fork](https://github.com/regexghost/gozer)). The website is hosted on a VPS from [Racknerd](https://www.racknerd.com/), using a domain from [Porkbun](https://porkbun.com/).
I previously used GitHub pages, but I thought it would be fun to have my own domain, and run my own server. Maybe one day I will try self-hosting from my home internet...
+
+## License
+
+Website content is copyright regexghost, source availble on GitHub. For any edits please open a GitHub issue or drop me an email. If you want to adapt something I've done on this website that's fine of course, as long as relevant credit is included.
+Most of my software projects are licensed under the GPL v3.0
diff --git a/devlog/2026-05-May.md b/devlog/2026-05-May.md
@@ -1,6 +1,6 @@
+++
title = "May 2026 Devlog"
-datepublished = 2026-05-13
+datePublished = 2026-05-13
template = "blog-page.html"
+++
diff --git a/devlog/2026-06-June.md b/devlog/2026-06-June.md
@@ -1,6 +1,6 @@
+++
title = "June 2026 Devlog"
-datepublished = 2026-06-21
+datePublished = 2026-06-21
template = "blog-page.html"
+++
diff --git a/gozer-files/templates/blog.html b/gozer-files/templates/blog.html
@@ -8,8 +8,8 @@
{{ .Content }}
<h2>Posts</h2>
<ul>
- {{ range .Pages }}
- {{ if HasPrefix .Filepath "content/blog/2" }}
+ {{ range .Posts }}
+ {{ if HasPrefix .Filepath "content/blog/" }}
<li>{{ .DatePublished.Format "2006-01-02" }} - <a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
{{ end }}
diff --git a/gozer-files/templates/devlog.html b/gozer-files/templates/devlog.html
@@ -6,8 +6,8 @@
{{template "top.html"}}
<h1>{{ .Title }}</h1>
{{ .Content }}
- {{ range .Pages }}
- {{ if HasPrefix .Filepath "content/devlog" }}
+ {{ range .Posts }}
+ {{ if HasPrefix .Filepath "content/devlog/" }}
<h2>{{ .Title }}</h2>
{{ Content . }}
{{ end }}
diff --git a/scripts/build.sh b/scripts/build.sh
@@ -17,7 +17,7 @@ gozer build
while read -r html_file; do
echo "$html_file"
- ./scripts/handle-escapes.sh "$html_file" | tidy -q -indent > /tmp/tidy_out.html
+ ./scripts/handle-escapes.sh "$html_file" | ./scripts/header-ids.sh | tidy -q -indent > /tmp/tidy_out.html
mv -f /tmp/tidy_out.html "$html_file"
done <<EOF
$(find /tmp/mainwebsite/build -type f | grep 'html$')
diff --git a/scripts/header-ids.sh b/scripts/header-ids.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+awk '{
+ if ($0 ~ /<h[1-6]>[^<]*<\/h[1-6]>/) { \
+ line = $0; \
+ sub(/[ \t]*<h/, "", line); \
+ level = line; \
+ sub(/>[^<]*<\/h[1-6].*/, "", level); \
+ title = line; \
+ sub(/^[1-6]>/, "", title); \
+ sub(/<\/h[1-6].*/, "", title);
+ id = title; \
+ gsub(/[^a-zA-Z0-9]/, "-", id); \
+ gsub(/---/, "-", id); \
+ $0 = "<h" level " id=\"" tolower(id) "\">" title "</h" level ">" \
+ } \
+ print \
+}'