Closed jon-harper closed 1 year ago
Hi @jon-harper Sorry for not replying earlier to your PR - when I saw this PR at the beginning of January I was busy and then I forgot completely to follow up... 🤦🏼
I am not convinced that addnig features that are specific to a JavaScript library is a good idea. I prefer to keep the library agnostic of third-party JavaScript libraries. The cards
plugin already supports adding specific id
and class
to the parent of the images, isn't it sufficient to exclude the selector of this library? I looked into the documentation of GLightbox and couldn´t find anything about the skip-lightbox class mentioned in the code of the PR.
Sorry for not replying earlier to your PR - when I saw this PR at the beginning of January I was busy and then I forgot completely to follow up... 🤦🏼
You're good! I completely forgot about it. I sent a short bit about it on Mastodon but promptly stopped using the platform, as well.
I am not convinced that addnig features that are specific to a JavaScript library is a good idea. I prefer to keep the library agnostic of third-party JavaScript libraries. The cards plugin already supports adding specific id and class to the parent of the images, isn't it sufficient to exclude the selector of this library?
You are quite right; that's one reason my brain kinda dropped off thinking about this.
I looked into the documentation of GLightbox and couldn´t find anything about the skip-lightbox class mentioned in the code of the PR.
I just visited and it looks like they completely redid the docs for the project. That's possibly an oversight on the documentation writer's part.
Anyway, since this definitely doesn't do anything new, I'll close it.
Lightbox will handily ruin any cards that have a
url
attribute. It moves the link from a parent element to an empty sibling; marking any child images with theskip-lightbox
class fixes this.markdown/image.py: I added a variable to the
build_image_html
method to add this class to the image. It defaults toFalse
, so it won't break existing code.cards/html.py: If the card has a URL, each
build_image_html
call asks for theskip-lightbox
class in the html.Hope this is helpful!
Edit: I fixed an issue where
item.url
beingNone
wasn't caught.