From fe347bea65b2327e282bbb6e43bce9e2dcc93c2b Mon Sep 17 00:00:00 2001 From: Deborah Barnard Date: Tue, 2 Jan 2024 14:39:08 +0000 Subject: [PATCH] add lightbox plugin and customise to avoid slideshow behavior --- docs/_extra/css/extra.css | 5 +++++ mkdocs.yml | 12 ++++++++++++ requirements.txt | 1 + 3 files changed, 18 insertions(+) diff --git a/docs/_extra/css/extra.css b/docs/_extra/css/extra.css index cb591fe32..74fcf09ca 100644 --- a/docs/_extra/css/extra.css +++ b/docs/_extra/css/extra.css @@ -185,6 +185,11 @@ .md-typeset :is(.emojione,.twemoji,.gemoji) svg { border: none; } + + /* remove lightbox controls so users can't slideshow */ + .gnext, .gprev { + display: none !important; + } /* reduce padding between title and breadcrumbs */ diff --git a/mkdocs.yml b/mkdocs.yml index bb88a871f..bc9916e83 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -122,6 +122,18 @@ plugins: # - info # Search is built in, but must be enabled when you add other plugins - search + # https://squidfunk.github.io/mkdocs-material/reference/images/#lightbox + - glightbox: + touchNavigation: false + loop: false + effect: zoom + slide_effect: none + width: auto + height: auto + zoomable: false + draggable: false + auto_caption: false + caption_position: bottom # https://mkdocs-macros-plugin.readthedocs.io/en/latest/ - macros: # https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#including-external-yaml-files diff --git a/requirements.txt b/requirements.txt index bf7515f1e..8473c87be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ +mkdocs-glightbox mkdocs-macros-plugin==1.0.4