Disable globally but enable by image or page
You can keep the whole site's images without lightbox effect but only enable lightbox effect on specific images or images on specific pages with the manual plugin option.
plugins:
- glightbox:
manual: true # enable manual mode, all images will not be added to the lightbox effect
Enable specific images
Enable lightbox effect on specific images by adding on-glb class to the image through markdown_extensions attr_list. Enable attr_list via mkdocs.yml:
Check more details about attr_list on the official document.
Demo
Only images with on-glb class will be added to the lightbox effect. Other images on the site will not be added to the lightbox effect.
{ .on-glb }
Lanyu, Taiwan. Credit: Blueswen
{ .on-glb }
Hallstatt, Austria. Credit: Blueswen

Madeira, Portugal. Credit: Blueswen

Enable specific pages
Enable lightbox effect on specific pages, add page metadata glightbox: true through markdown_extensions meta. Enable meta via mkdocs.yml:
Check more details about meta on the official document.
Demo
Only pages with glightbox: true meta will be added to the lightbox effect. Other images on the site will not be added to the lightbox effect.
---
glightbox: true
---

Cabo da Roca, Portugal. Credit: Blueswen

Yosemite, USA. Credit: Blueswen



