I really appreciate cheesy-gallery and switched out all my old galleries with it last night.

I woke up at 4 this morning, couldn’t manage to get back to sleep, so there was nothing to do but make some tea and do something relaxing. I went to bed feeling a little unhappy about my galleries not having alt values for screen readers, so I took the opportunity to learn about Jekyll site data to create a YAML hash of images in a gallery so I could include useful metadata at render.

I’ll just embed a gist to show how I set up the data file and used it in my gallery templates, because Liquid markup in a code block seems to be giving Hugo/micro.blog a case of the screaming fantods:

(For the record, David proposes a much more semantically correct way to structure the image markup. This is my v1, which amounted to using his gallery engine to drive my pre-existing templates. I want to go back and use his more thoughtful approach to this markup.)

It’s a little tedious editing YAML for the data file, but I’ve started a script to at least populate a some-gallery.yml file with the hashes for each image, and it’s not nearly as tedious as most web-based CMSes when it comes to asset management. And I could clean up the entire pipeline by being better about writing descriptions in Lightroom, then adding EXIF extraction to automating the data file creation.

Anyhow, the Lightbox plugin does you the favor of using your descriptions as captions if you put in the time to have descriptions, so the images display with that caption if there’s a key in the hash for the image, like this:

Gallery image with data-driven caption in the Lightbox display

So, an okay use of insomnia hours. Now I have a bunch of galleries to go make data for.