Skip to content

Commit ee57778

Browse files
committed
update docs
1 parent f0420bd commit ee57778

File tree

8 files changed

+145
-33
lines changed

8 files changed

+145
-33
lines changed

demo-mkdocs/docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A MkDocs plugin supports image lightbox with [GLightbox](https://github.com/biati-digital/glightbox).
44

5-
[GLightbox](https://github.com/biati-digital/glightbox) is pure Javascript lightbox library with mobile support.
5+
GLightbox is a pure javascript lightbox library with mobile support.
66

77
## Dependency
88

@@ -31,7 +31,7 @@ A MkDocs plugin supports image lightbox with [GLightbox](https://github.com/biat
3131
```yaml
3232
plugins:
3333
- glightbox:
34-
touchNavigation: false
34+
touchNavigation: true
3535
loop: false
3636
effect: zoom
3737
width: 100%
@@ -42,7 +42,7 @@ A MkDocs plugin supports image lightbox with [GLightbox](https://github.com/biat
4242

4343
| Option | Default | Description |
4444
|-----------------|---------|--------------------------------------------------------------------------------------------------------------|
45-
| touchNavigation | false | Enable or disable the touch navigation (swipe). |
45+
| touchNavigation | true | Enable or disable the touch navigation (swipe). |
4646
| loop | false | Loop slides on end. |
4747
| effect | zoom | Name of the effect on lightbox open. (zoom, fade, none) |
4848
| width | 100% | Default width for inline elements and iframes. You can use any unit for example 90% or 100vw for full width. |

demo-mkdocs/mkdocs.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@ theme:
1111

1212
features:
1313
- toc.integrate
14+
15+
palette:
16+
# Palette toggle for automatic mode
17+
- media: "(prefers-color-scheme)"
18+
toggle:
19+
icon: material/brightness-auto
20+
name: Switch to light mode
21+
22+
# Palette toggle for light mode
23+
- media: "(prefers-color-scheme: light)"
24+
scheme: default
25+
toggle:
26+
icon: material/brightness-7
27+
name: Switch to dark mode
28+
29+
# Palette toggle for dark mode
30+
- media: "(prefers-color-scheme: dark)"
31+
scheme: slate
32+
toggle:
33+
icon: material/brightness-4
34+
name: Switch to system preference
1435

1536
extra:
1637
analytics:
@@ -25,11 +46,7 @@ markdown_extensions:
2546
- pymdownx.superfences
2647

2748
plugins:
28-
- glightbox:
29-
touchNavigation: true
30-
loop: true
31-
height: auto
32-
width: 80%
49+
- glightbox
3350

3451
nav:
3552
- Home: index.md

docs/404.html

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@
6464

6565

6666

67+
68+
6769

6870

6971

70-
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="none" data-md-color-accent="none">
72+
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="" data-md-color-accent="">
7173

7274

7375

@@ -121,6 +123,39 @@
121123
</div>
122124
</div>
123125

126+
<form class="md-header__option" data-md-component="palette">
127+
128+
129+
130+
<input class="md-option" data-md-color-media="(prefers-color-scheme)" data-md-color-scheme="" data-md-color-primary="" data-md-color-accent="" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_0">
131+
132+
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
133+
<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>
134+
</label>
135+
136+
137+
138+
139+
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="" data-md-color-accent="" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">
140+
141+
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
142+
<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>
143+
</label>
144+
145+
146+
147+
148+
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="" data-md-color-accent="" aria-label="Switch to system preference" type="radio" name="__palette" id="__palette_2">
149+
150+
<label class="md-header__button md-icon" title="Switch to system preference" for="__palette_0" hidden>
151+
<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>
152+
</label>
153+
154+
155+
</form>
156+
157+
158+
<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>
124159

125160

126161

docs/gallery/index.html

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<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(){if(document.forms.search&&document.forms.search.query.addEventListener("blur",function(){this.value&&n("event","search",{search_term:this.value})}),document.forms.feedback){var e,a=document.forms.feedback;for(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}"undefined"!=typeof location$&&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>
1919
<script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>
2020
<link href="../assets/stylesheets/glightbox.min.css" rel="stylesheet"/><style>html.glightbox-open { overflow: initial; height: 100%; }</style><script src="../assets/javascripts/glightbox.min.js"></script></head>
21-
<body data-md-color-accent="none" data-md-color-primary="none" data-md-color-scheme="" dir="ltr">
21+
<body data-md-color-accent="" data-md-color-primary="" data-md-color-scheme="" dir="ltr">
2222
<input autocomplete="off" class="md-toggle" data-md-toggle="drawer" id="__drawer" type="checkbox"/>
2323
<input autocomplete="off" class="md-toggle" data-md-toggle="search" id="__search" type="checkbox"/>
2424
<label class="md-overlay" for="__drawer"></label>
@@ -50,6 +50,21 @@
5050
</div>
5151
</div>
5252
</div>
53+
<form class="md-header__option" data-md-component="palette">
54+
<input aria-label="Switch to light mode" class="md-option" data-md-color-accent="" data-md-color-media="(prefers-color-scheme)" data-md-color-primary="" data-md-color-scheme="" id="__palette_0" name="__palette" type="radio"/>
55+
<label class="md-header__button md-icon" for="__palette_1" hidden="" title="Switch to light mode">
56+
<svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><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"></path></svg>
57+
</label>
58+
<input aria-label="Switch to dark mode" class="md-option" data-md-color-accent="" data-md-color-media="(prefers-color-scheme: light)" data-md-color-primary="" data-md-color-scheme="default" id="__palette_1" name="__palette" type="radio"/>
59+
<label class="md-header__button md-icon" for="__palette_2" hidden="" title="Switch to dark mode">
60+
<svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><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"></path></svg>
61+
</label>
62+
<input aria-label="Switch to system preference" class="md-option" data-md-color-accent="" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-primary="" data-md-color-scheme="slate" id="__palette_2" name="__palette" type="radio"/>
63+
<label class="md-header__button md-icon" for="__palette_0" hidden="" title="Switch to system preference">
64+
<svg viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><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"></path></svg>
65+
</label>
66+
</form>
67+
<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>
5368
<div class="md-header__source">
5469
<a class="md-source" data-md-component="source" href="https://github.com/blueswen/mkdocs-glightbox" title="Go to repository">
5570
<div class="md-source__icon md-icon">
@@ -140,13 +155,13 @@
140155
<div class="md-content" data-md-component="content">
141156
<article class="md-content__inner md-typeset">
142157
<h1>Gallery</h1>
143-
<p><a class="glightbox" data-draggable="True" data-effect="zoom" data-height="auto" data-width="80%" data-zoomable="True" href="../images/gallery/blueswen-lanyu.jpeg"><img alt="Lanyu, Taiwan" src="../images/gallery/blueswen-lanyu.jpeg"/></a>
158+
<p><a class="glightbox" href="../images/gallery/blueswen-lanyu.jpeg"><img alt="Lanyu, Taiwan" src="../images/gallery/blueswen-lanyu.jpeg"/></a>
144159
Lanyu, Taiwan. Credit: Blueswen</p>
145-
<p><a class="glightbox" data-draggable="True" data-effect="zoom" data-height="auto" data-width="80%" data-zoomable="True" href="../images/gallery/blueswen-obertraun.jpeg"><img alt="Obertraun, Austria" src="../images/gallery/blueswen-obertraun.jpeg"/></a>
160+
<p><a class="glightbox" href="../images/gallery/blueswen-obertraun.jpeg"><img alt="Obertraun, Austria" src="../images/gallery/blueswen-obertraun.jpeg"/></a>
146161
Obertraun, Austria. Credit: Blueswen</p>
147-
<p><a class="glightbox" data-draggable="True" data-effect="zoom" data-height="auto" data-width="80%" data-zoomable="True" href="../images/gallery/blueswen-hallstatt.jpeg"><img alt="Hallstatt, Austria" src="../images/gallery/blueswen-hallstatt.jpeg"/></a>
162+
<p><a class="glightbox" href="../images/gallery/blueswen-hallstatt.jpeg"><img alt="Hallstatt, Austria" src="../images/gallery/blueswen-hallstatt.jpeg"/></a>
148163
Hallstatt, Austria. Credit: Blueswen</p>
149-
<p><a class="glightbox" data-draggable="True" data-effect="zoom" data-height="auto" data-width="80%" data-zoomable="True" href="../images/gallery/blueswen-lisbon.jpeg"><img alt="Castelo de São Jorge, Lisbon, Portugal" src="../images/gallery/blueswen-lisbon.jpeg"/></a>
164+
<p><a class="glightbox" href="../images/gallery/blueswen-lisbon.jpeg"><img alt="Castelo de São Jorge, Lisbon, Portugal" src="../images/gallery/blueswen-lisbon.jpeg"/></a>
150165
Castelo de São Jorge, Lisbon, Portugal. Credit: Blueswen</p>
151166
</article>
152167
<script>var input,hash=location.hash.slice(1);hash.startsWith("__tabbed_")&&((input=document.getElementById(hash)).checked=!0)</script>
@@ -188,5 +203,5 @@ <h1>Gallery</h1>
188203
</div>
189204
<script id="__config" type="application/json">{"base": "..", "features": ["toc.integrate"], "search": "../assets/javascripts/workers/search.720157f5.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "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.title": "Select version"}}</script>
190205
<script src="../assets/javascripts/bundle.5e3df397.min.js"></script>
191-
<script>document$.subscribe(() => {const lightbox = GLightbox({"touchNavigation": true, "loop": true});})</script></body>
206+
<script>document$.subscribe(() => {const lightbox = GLightbox({"touchNavigation": true, "loop": false, "width": "100%", "height": "auto", "zoomable": true, "draggable": true, "openEffect": "zoom", "closeEffect": "zoom"});})</script></body>
192207
</html>

0 commit comments

Comments
 (0)