More blog tinkering…

Fooling around with the templates, I set about fixing some indentation issues. It’s a long-standing annoyance of mine that Hugo’s markdown to HTML renderer throws away all indentation - I’m pretty sure you can fix it with something like:

{{ .Content | strings.ReplaceRE `[\r\n]` "\n      " | safeHTML }}

… however I wasn’t really happy with the results of this, so I elected to just wrap it in some HTML comments and be done with it. HTML comments are themselves ignored by Hugo’s templating engine for some reason, this was my solution:

{{ printf "<!-- this is a comment -->" | safeHTML }}

But for some reason, it was not happy with this inside the inline <script> tag? After quite a bit of experimentation, I finally Googled it… to learn that apparently HTML comments around inline Javascript hasn’t been necessary in like 20 years or some shit, and Hugo was actually Doing The Right Thing. Bah!

Anyway, I cleaned up a bunch of the indentation, threw away some more classes I didn’t need, and it’s actually not looking too bad right now. Did I do anything about the contrast ratio of light mode text? No, no I did not.

Oh, I also learned that SRI is useless for inline script elements, so I removed that. I’m sure some security scanner or another told me I needed it, but we’ll see. It seems to be fairly happy without it, in Firefox at least.

Update - 2025-08-14: I figured out a hackish way of making the main text black, and I put a black stroke around the logo for now so it’s visible. I also added some CSS which will make the top and bottom navigation links just icons if you’re on a mobile or really small screen, which stops it form having sideways scrolling for no damn reason.

I think that’s it most of the way “good enough” - I am of course itching to redo a theme from scratch because I’m starting to hate this one, but for now it’s definitely good enough.

Horsham, VIC, Australia fwaggle

Published:


Modified:


Filed under:


Location:

Horsham, VIC, Australia

Navigation: Older Entry Newer Entry