diff --git a/mkdocs_glightbox/plugin.py b/mkdocs_glightbox/plugin.py index 48c305a..a156d17 100644 --- a/mkdocs_glightbox/plugin.py +++ b/mkdocs_glightbox/plugin.py @@ -101,12 +101,14 @@ def on_post_page(self, output, page, config, **kwargs): }); """ js_code += f"const lightbox = GLightbox({json.dumps(lb_config)});\n" - if self.using_material or "navigation.instant" in config["theme"]._vars.get( + if self.using_material or "navigation.instant" in config["theme"].get( "features", [] ): # support compatible with mkdocs-material Instant loading feature js_code += "document$.subscribe(() => { lightbox.reload() });\n" - output = body_regex.sub(f'{js_code}', output) + output = body_regex.sub( + f'{js_code}', output + ) return output