If another plugin modifies the sources, it's not always true that this plugins files_source_dir dict will always contain the page.file.abs_src_path, and therefore this might throw an error:
def on_pre_page(self, page, config, files):
# Update page source attribute to point to source file
# Only in case any files were moved.
if len(self.files_source_dir) > 0:
page.file.abs_src_path = self.files_source_dir[page.file.abs_src_path]
return page
This code should check whether it was "managing" the source for the page via
if len(self.files_source_dir) > 0 && page.file.abs_src_path in self.files_source_dir:
before trying to change it (at Line 62 of plugin.py)
If another plugin modifies the sources, it's not always true that this plugins
files_source_dir
dict will always contain thepage.file.abs_src_path
, and therefore this might throw an error:From https://github.com/backstage/mkdocs-monorepo-plugin/blob/440382ac5825476ac6249c7808ce556d04173b0c/mkdocs_monorepo_plugin/plugin.py#L62
This code should check whether it was "managing" the source for the page via
before trying to change it (at Line 62 of plugin.py)