Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
blueswen committed Dec 30, 2023
1 parent 766ff81 commit bbe9949
Show file tree
Hide file tree
Showing 32 changed files with 1,517 additions and 372 deletions.
54 changes: 54 additions & 0 deletions demo-mkdocs/docs/disable/manual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
glightbox-manual: true
---

You can enable lightbox of images separately by adding page metadata ```glightbox-manual: true``` through markdown_extensions ```meta``` and adding ```on-glb``` class on the image through markdown_extensions ```attr_list```, and keep other images without lightbox effect. Enable ```meta``` and ```attr_list``` via ```mkdocs.yml```:

```yaml
markdown_extensions:
- meta
- attr_list
```
Check more details about ```meta``` on the [official document](https://python-markdown.github.io/extensions/meta_data/).

Check more details about ```attr_list``` on the [official document](https://python-markdown.github.io/extensions/attr_list/).

## Demo

Only images(first two images) with ```on-glb``` class will be added to the lightbox effect. Other images(third image) will be disabled.

```markdown
---
glightbox-manual: true
---
![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg){ .on-glb }
Lanyu, Taiwan. Credit: Blueswen
![Hallstatt, Austria](../images/gallery/blueswen-hallstatt.jpeg){ .on-glb }
Hallstatt, Austria. Credit: Blueswen
![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg)
Obertraun, Austria. Credit: Blueswen
```
<figure markdown>

![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg){ .on-glb }

<figcaption>Lanyu, Taiwan. Credit: Blueswen</figcaption>
</figure>

<figure markdown>

![Hallstatt, Austria](../images/gallery/blueswen-hallstatt.jpeg){ .on-glb }

<figcaption>Hallstatt, Austria. Credit: Blueswen</figcaption>
</figure>

<figure markdown>

![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg)

<figcaption>Obertraun, Austria. Credit: Blueswen</figcaption>
</figure>
1 change: 1 addition & 0 deletions demo-mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ nav:
- More Flexibility:
- Disable by image: disable/image.md
- Disable by page: disable/page.md
- Enable by image: disable/manual.md
122 changes: 81 additions & 41 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,25 @@


<link rel="icon" href="/blueswen/mkdocs-glightbox/assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.1.6+insiders-4.32.5">
<meta name="generator" content="mkdocs-1.5.3, mkdocs-material-9.4.11+insiders-4.44.0">



<title>MkDocs GLightbox</title>



<link rel="stylesheet" href="/blueswen/mkdocs-glightbox/assets/stylesheets/main.dc5b59cc.min.css">
<link rel="stylesheet" href="/blueswen/mkdocs-glightbox/assets/stylesheets/main.0ab26e37.min.css">


<link rel="stylesheet" href="/blueswen/mkdocs-glightbox/assets/stylesheets/palette.6932e648.min.css">
<link rel="stylesheet" href="/blueswen/mkdocs-glightbox/assets/stylesheets/palette.ab4e12ef.min.css">










Expand All @@ -51,16 +54,13 @@




<script id="__analytics">function __md_analytics(){function n(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],n("js",new Date),n("config","G-KQTG9N2Y4N"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){this.value&&n("event","search",{search_term:this.value})}),document$.subscribe(function(){var a=document.forms.feedback;if(void 0!==a)for(var e of a.querySelectorAll("[type=submit]"))e.addEventListener("click",function(e){e.preventDefault();var t=document.location.pathname,e=this.getAttribute("data-md-value");n("event","feedback",{page:t,data:e}),a.firstElementChild.disabled=!0;e=a.querySelector(".md-feedback__note [data-md-value='"+e+"']");e&&(e.hidden=!1)}),a.hidden=!1}),location$.subscribe(function(e){n("config","G-KQTG9N2Y4N",{page_path:e.pathname})})});var e=document.createElement("script");e.async=!0,e.src="https://www.googletagmanager.com/gtag/js?id=G-KQTG9N2Y4N",document.getElementById("__analytics").insertAdjacentElement("afterEnd",e)}</script>

<script id="__analytics">function __md_analytics(){function n(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],n("js",new Date),n("config","G-KQTG9N2Y4N"),document.addEventListener("DOMContentLoaded",function(){document.forms.search&&document.forms.search.query.addEventListener("blur",function(){this.value&&n("event","search",{search_term:this.value})}),document$.subscribe(function(){var a=document.forms.feedback;if(void 0!==a)for(var e of a.querySelectorAll("[type=submit]"))e.addEventListener("click",function(e){e.preventDefault();var t=document.location.pathname,e=this.getAttribute("data-md-value");n("event","feedback",{page:t,data:e}),a.firstElementChild.disabled=!0;e=a.querySelector(".md-feedback__note [data-md-value='"+e+"']");e&&(e.hidden=!1)}),a.hidden=!1}),location$.subscribe(function(e){n("config","G-KQTG9N2Y4N",{page_path:e.pathname})})});var e=document.createElement("script");e.async=!0,e.src="https://www.googletagmanager.com/gtag/js?id=G-KQTG9N2Y4N",document.getElementById("__analytics").insertAdjacentElement("afterEnd",e)}</script>

<script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>





</head>


Expand All @@ -71,7 +71,7 @@



<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="" data-md-color-accent="">
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo">


<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
Expand All @@ -98,6 +98,7 @@

</a>
<label class="md-header__button md-icon" for="__drawer">

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
Expand All @@ -117,33 +118,41 @@
</div>
</div>

<form class="md-header__option" data-md-component="palette">


<input class="md-option" data-md-color-media="(prefers-color-scheme)" data-md-color-scheme="default" data-md-color-primary="" data-md-color-accent="" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_0">

<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m14.3 16-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9h-1.9M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69m-9.15 3.96h2.3L12 9l-1.15 3.65Z"/></svg>
</label>



<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="teal" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">

<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"/></svg>
</label>



<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="teal" data-md-color-accent="teal" aria-label="Switch to system preference" type="radio" name="__palette" id="__palette_2">

<label class="md-header__button md-icon" title="Switch to system preference" for="__palette_0" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12c0-2.42-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"/></svg>
</label>


</form>

<form class="md-header__option" data-md-component="palette">




<input class="md-option" data-md-color-media="(prefers-color-scheme)" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_0">

<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m14.3 16-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9h-1.9M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69m-9.15 3.96h2.3L12 9l-1.15 3.65Z"/></svg>
</label>





<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="teal" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">

<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"/></svg>
</label>





<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="teal" data-md-color-accent="teal" aria-label="Switch to system preference" type="radio" name="__palette" id="__palette_2">

<label class="md-header__button md-icon" title="Switch to system preference" for="__palette_0" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12c0-2.42-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12 20 8.69Z"/></svg>
</label>


</form>



<script>var media,input,key,value,palette=__md_get("__palette");if(palette&&palette.color){"(prefers-color-scheme)"===palette.color.media&&(media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']"),palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent"));for([key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
Expand All @@ -155,7 +164,7 @@
<a href="https://github.com/blueswen/mkdocs-glightbox" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
blueswen/mkdocs-glightbox
Expand Down Expand Up @@ -203,7 +212,7 @@
<a href="https://github.com/blueswen/mkdocs-glightbox" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
blueswen/mkdocs-glightbox
Expand Down Expand Up @@ -246,14 +255,16 @@





<li class="md-nav__item md-nav__item--nested">





<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >


<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">


Expand Down Expand Up @@ -399,14 +410,16 @@





<li class="md-nav__item md-nav__item--nested">





<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >


<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">


Expand Down Expand Up @@ -487,6 +500,32 @@








<li class="md-nav__item">
<a href="/blueswen/mkdocs-glightbox/disable/manual/" class="md-nav__link">


<span class="md-ellipsis">


Enable by image



</span>



</a>
</li>




</ul>
</nav>

Expand Down Expand Up @@ -541,10 +580,11 @@ <h1>404 - Not found</h1>
<div class="md-dialog__inner md-typeset"></div>
</div>

<script id="__config" type="application/json">{"base": "/blueswen/mkdocs-glightbox/", "features": ["toc.integrate"], "search": "/blueswen/mkdocs-glightbox/assets/javascripts/workers/search.6c7302c4.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>

<script id="__config" type="application/json">{"base": "/blueswen/mkdocs-glightbox/", "features": ["toc.integrate"], "search": "/blueswen/mkdocs-glightbox/assets/javascripts/workers/search.1e90e0fb.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>


<script src="/blueswen/mkdocs-glightbox/assets/javascripts/bundle.803ed251.min.js"></script>
<script src="/blueswen/mkdocs-glightbox/assets/javascripts/bundle.6981e6db.min.js"></script>


</body>
Expand Down
3 changes: 3 additions & 0 deletions docs/assets/javascripts/bundle.6981e6db.min.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions docs/assets/javascripts/bundle.803ed251.min.js

This file was deleted.

3 changes: 0 additions & 3 deletions docs/assets/javascripts/bundle.ba7fc6cf.min.js

This file was deleted.

Loading

0 comments on commit bbe9949

Please sign in to comment.