Skip to content

Commit

Permalink
Add compatibility for lightgallery-markdown when use_directory_urls i…
Browse files Browse the repository at this point in the history
…s set to True
  • Loading branch information
timvink committed Feb 16, 2022
1 parent e8e3b38 commit 11faed7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mkdocs_print_site_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,9 @@ def on_post_build(self, config, **kwargs):
# <link href="//assets/css/somecss.css">
# Details https://github.com/timvink/mkdocs-print-site-plugin/issues/68
htmls = html.split("</head>")
htmls[0] = htmls[0].replace("href=\"//", "href=\"")
htmls[0] = htmls[0].replace("src=\"//", "src=\"")
base_url = "../" if config.get("use_directory_urls") else ""
htmls[0] = htmls[0].replace("href=\"//", f"href=\"{base_url}")
htmls[0] = htmls[0].replace("src=\"//", f"src=\"{base_url}")
html = "</head>".join(htmls)

# Determine calls to required javascript functions
Expand Down

0 comments on commit 11faed7

Please sign in to comment.