Why do you hate me? WHY? ;-)
The problem seems to be that we need the "islink" class applied to the link element. It does not work in the external figure's div element, nor in the img element.
If I use the :figclass: option, the class is applied to the div.
If I use the :class: option, the class is applied to the img.
Is there a sane/standard way to apply a class to the anchor?
I suppose there isn't, so I went with the :class: option, copied the base.tmpl template :( to my custom theme, and modified it like this:
<script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
I *hate* jQuery selectors, but I suppose that means "anchors with the image-reference class that don't have the islink class AND whose child img element does not have the islink class". And for some reason that selects the img node, so I put a parent() there too, to go back to the anchor and apply colorbox to it.
It solves my scenario, but:
- It seems a bit overkill to override base.tmpl (I consider it an important template...) in a custom theme just for that;
- I'm not sure if that jQuery selector is right
- I'm not sure if I'm not breaking other scenarios (I see that the islink trick was added more or less recently
https://github.com/getnikola/nikola/issues/1536)
Ideas?