Skip to content

Commit 11faed7

Browse files
committed
Add compatibility for lightgallery-markdown when use_directory_urls is set to True
1 parent e8e3b38 commit 11faed7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mkdocs_print_site_plugin/plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,9 @@ def on_post_build(self, config, **kwargs):
358358
# <link href="//assets/css/somecss.css">
359359
# Details https://github.com/timvink/mkdocs-print-site-plugin/issues/68
360360
htmls = html.split("</head>")
361-
htmls[0] = htmls[0].replace("href=\"//", "href=\"")
362-
htmls[0] = htmls[0].replace("src=\"//", "src=\"")
361+
base_url = "../" if config.get("use_directory_urls") else ""
362+
htmls[0] = htmls[0].replace("href=\"//", f"href=\"{base_url}")
363+
htmls[0] = htmls[0].replace("src=\"//", f"src=\"{base_url}")
363364
html = "</head>".join(htmls)
364365

365366
# Determine calls to required javascript functions

0 commit comments

Comments
 (0)