diff --git a/markdownextradata/plugin.py b/markdownextradata/plugin.py index 25bca2c..3b52d72 100644 --- a/markdownextradata/plugin.py +++ b/markdownextradata/plugin.py @@ -101,7 +101,11 @@ def on_page_markdown(self, markdown, page, **kwargs): # Initialize this mkdocs config and Jinja2 env def on_config(self, mkdocsConfig, **kwargs): jinja_options = self.config[self.JINJA_OPTIONS] - self.env = jinja2.Environment(undefined=jinja2.DebugUndefined, **jinja_options) + self.env = jinja2.Environment( + undefined=jinja2.DebugUndefined, + loader=jinja2.FileSystemLoader(mkdocsConfig["docs_dir"]), + **jinja_options + ) self.mkdocsConfig = mkdocsConfig # Apply Jinja2 substitution to specified string