CHANGELOG 2024-11-01
Here's a list of small changes around the site that didn't necessarily warrant their own individual posts.
-----
I introduced the "💯 Chronicles of a Critic" section and added my existing (2!) book reports to it, along with a recent movie review. I'm not going to write something up for _everything_ I watch or read, just ones for which I have something I want to say.
-----
I added Signal to the donations area. I've been a dedicated user for a long time, and figured it's time to give back.
-----
On the HTTP version of the site images will now be automatically inlined into the page, rather than requiring the user to click a link. See Happy Trees [0] for an example.
I was able to do this as a result of work I've done on my custom Caddy plugins [1]. I added a new HTTP middleware plugin which does the gemtext->HTML conversion, and as a result I have much greater control over how the HTML rendering happens than I did before.
Using this new plugin I am able render gemtext links in HTML using an arbitrary template. For this site the template I'm using does the work of injecting a gemini gateway for `gemini://` links, as well as inlining images. It looks like this:
{{- $url := .URL }} {{- $label := .Label }} {{- $isGemini := hasPrefix "gemini://" $url }} {{- $ext := $url | ext | lower }} {{- $isImg := any (eq $ext ".jpg") (eq $ext ".jpeg") (eq $ext ".png") (eq $ext ".svg") }} {{- if (and $isImg (not $isGemini)) }} <p style="text-align: center;"> <a href="{{ $url }}"> <img src="{{ $url }}" alt="{{ $label }}" style="width: 600px;" /> </a> {{- if (ne $label $url) }} <br/><small><em>{{ $label }}</em></small> {{- end }} </p> {{ else }} {{- if $isGemini }} {{- $url = $url | trimPrefix "gemini://" | print "https://portal.mozz.us/gemini/" }} {{- $label = print $label " (proxied)" }} {{- end -}} <p><a href="{{ $url }}">{{ $label }}</a></p> {{ end }}
The next plugin I'm thinking about will also be image related; I want something which will automatically resize images server-side based on a query parameter. This was a feature which existed as part of my old CMS I had written, and it was very useful for serving a smaller version of an image on a page while linking to the full-sized image, all without having to manually run a "convert images into different sizes".
I've got a few more posts in the pipeline, so keep yours eyes open!
This site is a mirror of my gemini capsule. The equivalent gemini page can be found here, and you can learn more about gemini at my 🚀 What is Gemini? page.