diff --git a/mkdocs_print_site_plugin/plugin.py b/mkdocs_print_site_plugin/plugin.py index 86010bc..a6f2d11 100644 --- a/mkdocs_print_site_plugin/plugin.py +++ b/mkdocs_print_site_plugin/plugin.py @@ -253,6 +253,12 @@ def on_template_context(self, context, template_name, config, **kwargs): # print(f"\nName: {template_name}\nContext: {context.get('extra_css')}") if template_name == "404.html": self.context = context + # Make sure paths are OK + if config.get('extra_css'): + self.context['extra_css'] = [get_relative_url(f, self.print_page.file.url) for f in config.get('extra_css')] + if config.get('extra_javascript'): + self.context['extra_javascript'] = [get_relative_url(f, self.print_page.file.url) for f in config.get('extra_javascript')] + def on_post_build(self, config, **kwargs): """ @@ -297,6 +303,7 @@ def on_post_build(self, config, **kwargs): # Get the info for MkDocs to be able to apply a theme template on our print page env = config["theme"].get_env() + # env.list_templates() template = env.get_template("main.html") self.context["page"] = self.print_page # Render the theme template for the print page diff --git a/setup.py b/setup.py index 8251d01..40aacb9 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="mkdocs-print-site-plugin", - version="2.2.2", + version="2.2.3", description="MkDocs plugin that combines all pages into one, allowing for easy export to PDF and standalone HTML.", long_description=long_description, long_description_content_type="text/markdown",