commit 4db9d97a8e81fd6596d46c14f4636af615152d63
parent 67a1d4ac7d4c7f88ec6c50865647a3831d0b2793
Author: regexghost <dev@regexghost.com>
Date: Tue, 7 Jul 2026 18:37:08 +0100
added handle-escapes and coloured text escapes
Diffstat:
3 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/build.sh b/build.sh
@@ -10,16 +10,18 @@ cp -r gozer-files/config.toml /tmp/mainwebsite/
cp -r index.md about.md /tmp/mainwebsite/content/
cp -r linux other blog devlog coding /tmp/mainwebsite/content/
cp -r static /tmp/mainwebsite/public
+cp handle-escapes.sh /tmp/mainwebsite/
cd /tmp/mainwebsite
gozer build
while read -r html_file; do
echo "$html_file"
- tidy -q -indent "$html_file" > /tmp/tidy_out.html
+ ./handle-escapes.sh "$html_file" | 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$')
EOF
-[ "$1" = "serve" ] && gozer serve
+# Using python http.server instead of inbuilt gozer serve as serve re-builds, overwriting my changes with ./handle-escapes.sh and tidy
+[ "$1" = "serve" ] && python3 -m http.server -d build/
diff --git a/handle-escapes.sh b/handle-escapes.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+inputFile="$1"
+
+sed 's/\\c-off /<\/span>/g' "$inputFile" |\
+sed 's/\\c-\([a-z]*\) /<span class="text-\1">/g'
diff --git a/static/style.css b/static/style.css
@@ -5,7 +5,6 @@ body {
margin: auto;
}
-
a {
color: #94e2d5;
}
@@ -151,3 +150,27 @@ div.header img {
top: 4px;
margin: 0px 6px 0px 6px;
}
+
+span.text-red {
+ color: #f38ba8;
+}
+
+span.text-green {
+ color: #a6e3a1;
+}
+
+span.text-yellow {
+ color: #f9e2af;
+}
+
+span.text-blue {
+ color: #89b4fa;
+}
+
+span.text-magenta {
+ color: #f5c2e7;
+}
+
+span.text-cyan {
+ color: #94e2d5;
+}