diff --git a/demo-mkdocs/docs/disable/image.md b/demo-mkdocs/docs/disable/image.md new file mode 100644 index 0000000..6d49a68 --- /dev/null +++ b/demo-mkdocs/docs/disable/image.md @@ -0,0 +1,26 @@ +You can disable lightbox of images separately by adding ```off-glb``` class through markdown_extensions ```attr_list```. Enable ```attr_list``` via ```mkdocs.yml```: + +```yaml +markdown_extensions: + - attr_list +``` + +Check more detail about ```attr_list``` on the [official document](https://python-markdown.github.io/extensions/attr_list/). + +## Demo + +The first image's lightbox is disabled. + +```markdown +![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg){ .off-glb } +Lanyu, Taiwan. Credit: Blueswen + +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) +Obertraun, Austria. Credit: Blueswen +``` + +![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg){ .off-glb } +Lanyu, Taiwan. Credit: Blueswen + +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) +Obertraun, Austria. Credit: Blueswen diff --git a/demo-mkdocs/docs/disable/page.md b/demo-mkdocs/docs/disable/page.md new file mode 100644 index 0000000..67a5a76 --- /dev/null +++ b/demo-mkdocs/docs/disable/page.md @@ -0,0 +1,34 @@ +--- +glightbox: false +--- + +You can disable lightbox of all images on a specific page by adding page metadata ```glightbox: false``` through markdown_extensions ```meta```. Enable ```meta``` via ```mkdocs.yml```: + +```yaml +markdown_extensions: + - meta +``` + +Check more detail about ```meta``` on the [official document](https://python-markdown.github.io/extensions/meta_data/). + +## Demo + +All images' lightbox are disabled on this page. + +```markdown +--- +glightbox: false +--- + +![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg) +Lanyu, Taiwan. Credit: Blueswen + +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) +Obertraun, Austria. Credit: Blueswen +``` + +![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg) +Lanyu, Taiwan. Credit: Blueswen + +![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg) +Obertraun, Austria. Credit: Blueswen diff --git a/demo-mkdocs/docs/index.md b/demo-mkdocs/docs/index.md index 6958480..1d47f31 100644 --- a/demo-mkdocs/docs/index.md +++ b/demo-mkdocs/docs/index.md @@ -7,7 +7,7 @@ GLightbox is a pure javascript lightbox library with mobile support. ## Dependency 1. Python Package - 1. beautifulsoup4==4.11.1 + 1. beautifulsoup4>=4.11.1 2. GLightbox javascript file and css file 1. GLightbox==3.2.0 @@ -19,7 +19,7 @@ GLightbox is a pure javascript lightbox library with mobile support. pip install mkdocs-glightbox ``` -2. Add ```glightbox``` plugin in to your mkdocs.yml plugins sections: +2. Add ```glightbox``` plugin to your mkdocs.yml plugins sections: ```yaml plugins: @@ -52,9 +52,11 @@ GLightbox is a pure javascript lightbox library with mobile support. Check more options information on [GLightbox Docs](https://github.com/biati-digital/glightbox#lightbox-options). +4. For more flexibility, you can disable lightbox by a [specific image](./disable/image.md) or a [specific page](./disable/page.md). + ## Demo -Click image to try lightbox and enjoy the view of Taiwan. +Click the image to try lightbox and enjoy the view of Taiwan. ![Sunset over Taipei City](./images/thomas-tucker-sunset-over-taipei-city.jpg) Sunset over Taipei City. Credit: [Thomas Tucker](https://unsplash.com/photos/au3CYbd7vCU) diff --git a/demo-mkdocs/mkdocs.yml b/demo-mkdocs/mkdocs.yml index 1ac4c5e..c13196d 100644 --- a/demo-mkdocs/mkdocs.yml +++ b/demo-mkdocs/mkdocs.yml @@ -44,6 +44,8 @@ markdown_extensions: - pymdownx.inlinehilite - pymdownx.snippets - pymdownx.superfences + - attr_list + - meta plugins: - glightbox @@ -54,3 +56,6 @@ nav: - Sea: taiwan/sea.md - Mountain: taiwan/mountain.md - Gallery: gallery.md + - More Flexibility: + - Disable by image: disable/image.md + - Disable by page: disable/page.md diff --git a/docs/404.html b/docs/404.html index 09c7d2d..ed287c7 100644 --- a/docs/404.html +++ b/docs/404.html @@ -12,7 +12,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -82,6 +82,10 @@ + + + + @@ -346,6 +350,87 @@ + + + + + + + + + + + + +