feat: remove .html suffix from urls Adds a script to generate the rewrite rule that rewrites specific "pages" URLs. Probably incorporate this into a pre-commit hook or something to remind me to update this directive when adding new pages. Makes it even harder to hide pages, but tbh if you're the type of person to go trawling through the git repo, then you're probably not the kind of person I can keep secrets from. ;)
shwarp
Sat, 31 Oct 2026 00:14:08 -0400
8 files changed,
35 insertions(+),
12 deletions(-)
A
config/pages.redirects
@@ -0,0 +1,1 @@
+rewrite ^/(about|colophon|home|DOOM|DOOM\/wads|DOOM\/wads\/tdsw|now|codemon|todo)$ /pages/$1.html last;
M
pages/DOOM.html
→
pages/DOOM.html
@@ -36,7 +36,7 @@ <section>
<h2>WADs by me</h2> <p> Maybe I'll make a little page for each of these, idk. But for now - I don't even have all the files, <a href="/DOOM/wads.html"> + I don't even have all the files, <a href="/DOOM/wads"> so here are a selection of WADs</a> that I feel like sharing right now. </p>
M
pages/DOOM/wads.html
→
pages/DOOM/wads.html
@@ -12,9 +12,9 @@ <header>
<h1> <a href="/"><img src="/static/img/invuln.gif" alt="Pulsing green Invulnerability Sphere skull"></a> / - <a href="/DOOM.html">DOOM</a> + <a href="/DOOM">DOOM</a> <span>/</span> - <a href="/DOOM/wads.html">WADs</a> + <a href="/DOOM/wads">WADs</a> </h1> </header>@@ -30,7 +30,7 @@ </section>
<section> <h2>Works in progress</h2> <p> - See my <a href="/now.html">now page</a> for what I'm currently working on. + See my <a href="/now">now page</a> for what I'm currently working on. </p> </section> </main>
M
pages/about.html
→
pages/about.html
@@ -21,7 +21,7 @@ between them, but just because I like to have separate spaces for
separate {interests,fixations,obsessions}. The base "template" for this was <span title="copy+pasted">adapted</span> from another website I have out there's on the indiewebz (I'm sure I have more - to say it over at the <a href="/colophon.html">colophon</a> + to say it over at the <a href="/colophon">colophon</a> page. </p> <p>
M
pages/colophon.html
→
pages/colophon.html
@@ -8,7 +8,7 @@ <section>
<h2>Hubris and shame</h2> <p> You can see my plans for this place - <a href="/todo.html">here</a>. + <a href="/todo">here</a>. </p> </section> <section>
A
scripts/gen-nginx-rewrites
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash + +# Generates a rewrite rules to convert URIs that would look like +# /pages/cats/megan.html +# into: +# /cats/megan ✨ +# +# You probably want to place my output somewhere like +# /etc/nginx/conf.d/pages.redirects, but that's just my opinion + +pages=$( + find ./pages -name \*html \ + | xargs -I% echo % \ + | sed -r 's|^\./pages/(.*)\.html$|\1|' \ + | sed -r 's|/|\\/|g' \ + | tr \\n \| \ + | rev \ + | cut -c 2- \ + | rev +) + +echo "rewrite ^/($pages)$ /pages/\$1.html last;"
M
stubs/header.shtml
→
stubs/header.shtml
@@ -12,7 +12,7 @@ <header>
<h1> <a href="/"><img src="/static/img/invuln.gif" alt="Pulsing green Invulnerability Sphere skull"></a> / - <a href="<!--# echo var="page-title" default="???" -->.html"> + <a href="<!--# echo var="page-title" default="???" -->"> <!--# echo var="page-title" default="???" --> </a> </h1>