This is mostly for @jsonbecker but thought I’d post it publicly… Today we’re going to roll out Micro.blog “photo collections”. There is some default CSS and JS for these, but I think it would be cool if the GLightbox plug-in is installed, the collections use GLightbox instead.
I’m not very familiar with GLightbox, so happy to hear any suggestions. The default HTML that Micro.blog generates looks like this:
Interestingly, glightbox doesn’t wrap things in a div by default. I couldn’t really figure out how to do that in a way that was satisfactory, so I just offer an img-gallery css class that folks can use on their own for that styling. The actual image content is here:
It’s not too dissimilar – there’s a data-gallery property that makes sure that on a page with multiple image galleries they stay separate (you can name them or it’ll be per post using the post uniqueID) and then data-glightbox which contains things like title and description for the lightbox. That’s all on a link to the image itself, which is just a normal img entity.
I wonder if I could wrap using hte microblog_collections class and dump the img-gallery CSS I ship.
Cool, thanks for looking at this. I think ideally a plug-in like GLightbox could hook into the default styling in Micro.blog collections, but also all the other shortcodes would be available for people who want more control. We may need to tinker with a couple ideas, and I’m open to changing Micro.blog’s internals if it helps, such as overriding the default CSS class.