Tagged #wilhelm.codes.
14 entries.
week 1
week 2
week 3
week 4
week 5
week 6
week 7
week 8
week 9
week 10
week 11
week 12
week 13
week 14
week 15
week 16
week 17
week 18
week 19
week 20
week 21
week 22
week 23
week 24
week 25
week 26
week 27
week 28
week 29
week 30
week 31
week 32
week 33
week 34
week 35
week 36
week 37
week 38
week 39
week 40
week 41
week 42
week 43
week 44
week 45
week 46
week 47
week 48
week 49
week 50
week 51
week 52
14 entries over 52 weeks of #wilhelm.codes activity. Less More
Writing 3 posts
Let Me Show You My Bits
Some Long Overdue Housekeeping
Bits 11 bits
Whatever you do, do not add ?sparks to the end of the URL of any page with an activity graph. I’m pleading with you, reader. It is not at all silly and definitely NOT at all “fun”.
I’ve been rebuilding the public landing page for the homelab this weekend and somewhere in the middle of it I laid a scanline over the whole thing. It’s a single hairline that repeats itself every three pixels. It’s faint enough that the page stops looking quite so flat without you ever working out why. Then, obviously, I wanted it here too.
The lazy version is a white line at about 1.5% opacity, which is what the other page uses, because the other page is forty words of neon over black; legibility isn’t really the goal. However, this site is mostly prose, so a white line lightens the words as well as the background. I didn’t spend all that time on the reading column just to lay a haze over it.
So the grain mixes off --text instead of white:
--grain: color-mix(in srgb, var(--text) 1.5%, transparent);This can be applied like so:
.grain {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 10;
background: repeating-linear-gradient(
to bottom,
var(--grain) 0 1px,
transparent 1px 3px
);
}And finally referened like so just above the closing </body> tag:
<div class="grain" aria-hidden="true"></div>This works out great, because a colour mixed with itself gives that colour straight back. The grain physically cannot touch the body copy. I’ve learned quite a few new things today!
As a bonus the lightbox is a <dialog> and the browser promotes a modal dialog into the top layer. This sits above every z-index on the page; including the one holding the grain. So a zoomed photograph comes up perfectly clean and I didn’t have to write a rule to make that happen.
Whether you can see any of this depends entirely on your monitor, your colour settings and even your resolution. If you can’t see it, it’s working.
Page loads had been creeping up again, so I went looking. Turns out I’d been quietly serving enormous screenshots. One post was pulling 5.1 MB of PNGs, and a single one of those was a 1.96 MB app screenshot sitting in a column 736 pixels wide. Oof.
The fix was mostly plumbing. My img shortcode was handing the raw src straight to the <img> tag, so Hugo never got a look in. Everything now goes through one partial that resizes to the width it actually displays at, re-encodes to WebP and emits a srcset, plus width and height so the layout stops jumping around while things load. Markdown images get the same treatment through a render hook. The awkward bit: images under static/ aren’t resources, so Hugo can’t touch them. A second mount in hugo.toml fixes that without breaking any existing URLs.
While I was in there I dealt with the JavaScript. Every page was carrying all seven inline scripts, even the 90-odd pages with no code blocks, no zoomable images and no locked series titles. Those three now load only where they actually do something. The two that genuinely run everywhere moved into one small fingerprinted bundle, so your browser fetches it once for the whole visit instead of re-reading it on every page. I also finally turned on HTML minification, which I’d apparently never bothered with.
Where it landed:
| what | before | after |
|---|---|---|
| Images the site serves | 12.3 MB | 1.5 MB |
| HTML over the wire, mean per page | 10,236 B | 6,671 B |
| Worst offending post, first paint | 5.1 MB | 112 KB |
That last one is about 46 times smaller. Nothing changed visually, which was the whole point. The sparks still spark and the locked titles still scramble.
One last silly thing. I added a new short code to style “Plant Smart” as “Plant🌱Smart”. Fun!
Welp, I finally did it! I’ve moved the git repository for this site from Github to the Forgejo instance in my homelab. Further, I’ve replaced Cloudflare’s build pipeline with a simple 20-line YAML file used by my Woodpecker CI server, which is also hosted in my homelab. I’m still using Wrangler to push the static assets to Cloudflare Pages and I’ll always need an external DNS provider for my domain, but you can’t reasonably self-host everything.
It’s nice to have almost full control of my little website now! And all it took was 3 attempts to get the integration right. 😅

A great note to end on for a Monday evening!
Goodbye Tailwind. Goodbye Node. We’re rolling vanilla HTML, CSS and JS. No more webfonts, we on them system faces now. A couple of hours on I have not missed the webfonts once. The site is lighter, the text is sharper on my screen and the only person who ever noticed was me. 750kb cold start for the main page is now under 18kb.
Everything is so much faster now I should’ve done this months ago when I first revamped the site.
Spent an evening on the tags. A few of them were doing the same job under different names, so the duplicates are merged and the thin ones are gone. The cloud in the rail is shorter and rather more honest for it.
Having a play with a more dynamic menu drawer. Just working out the kinks on smaller screens.
Decided to introduce a new projects page to showcase some of the bigger things I’m working on. I’m still working out the kinks and I’m not 100% sold on the current design. Each card is powered by a .toml based datasource in Hugo, contains a kind of linear heatmap of activity related to the associated project’s tag as well as the 5 latest related posts. Good enough to publish, I guess.
I also can’t decide on which activity graph animation I like the most. 😅
I am very smart. I only just realised over the weekend that issues and discussions in the parent repo for this site were disabled. Meaning, article coments using Giscuss was functionally disabled here. WOOPS!
Some small incremental updates for the site today:
- The addition of a new bit type for site updates like this one.
- Proper RSS feeds for both long-form articles and bits. Check the footer!
- A quick sweep of the site map to ensure everything maps out properly. There were a few dead links previously.
- You can now filter bits by type! Have a play with it at the top of this page.
- Some minor grammatical updates here and there for some recent content.
Something to note is that the bits filter is purely JS based and assumes all content will be displayed in a single page. This is fine for now, but there may be 100s or even 1,000s of entries on a long enough timeline. At that point, basic text search and filtering that supports pagination may be necessary. But, not today!
I am not a smart man. I completely forgot I was using the “Pro” version of FontAwesome and had the entire library committed to this very public repository without any licensing coverage. I mean, the pro version shouldn’t be shared anyway. You may have noticed the associated Github repository has been temporarily set to private and that all commit history as been wiped. Sucks, but I felt this was much more pragmatic than removing multiple specific files from the tree. I am not an expert git surgeon, so that got a hard pass from me.
I’m currently experimenting with some alternative OPEN SOURCE web icons and updating the third-party licensing notice bundled with the repo to cover icons as well as web fonts.
Luckily, only I noticed this issue and immediately worked to address it.
edit: Good-bye, sweet git history!