diff --git a/configs/mkdocs_basic.yml b/configs/mkdocs_basic.yml index 5367a48e..d330f7a5 100644 --- a/configs/mkdocs_basic.yml +++ b/configs/mkdocs_basic.yml @@ -24,5 +24,7 @@ plugins: - literate-nav - mknodes: build_fn: mknodes.navs.mkdefaultwebsite:MkDefaultWebsite.for_project + kwargs: + show_debug_section: true clone_depth: 100 - mkdocstrings diff --git a/mknodes/project.py b/mknodes/project.py index df9edde5..6c9761d8 100644 --- a/mknodes/project.py +++ b/mknodes/project.py @@ -79,13 +79,16 @@ def build(self): from mknodes.basenodes import mknode - paths = [pathlib.Path(i).stem for i in self._root.page_mapping] + mapping = self._root.page_mapping + + paths = [pathlib.Path(i).stem for i in mapping] self.linkprovider.set_excludes(paths) variables = self.context.as_dict() - variables["page_mapping"] = self._root.page_mapping - variables["requirements"] = self.get_requirements() - mknode.MkNode._env.globals |= variables + reqs = self.get_requirements() + ctx = contexts.BuildContext(page_mapping=mapping, requirements=reqs) + mknode.MkNode._env.globals |= variables | ctx.as_dict() + return ctx def __repr__(self): return reprhelpers.get_repr(self, repo_path=str(self.folderinfo.path)) @@ -140,13 +143,6 @@ def get_requirements(self) -> requirements.Requirements: ) return reqs - @functools.cached_property - def build_context(self): - return contexts.BuildContext( - page_mapping=self.folderinfo.git.context, - requirements=self.get_requirements(), - ) - @functools.cached_property def context(self): return contexts.ProjectContext(