diff --git a/mknodes/cli/__init__.py b/mknodes/cli/__init__.py index d7f2514b..cd71f71b 100644 --- a/mknodes/cli/__init__.py +++ b/mknodes/cli/__init__.py @@ -177,6 +177,7 @@ def create_config( build_fn=build_fn, clone_depth=1, ) + proj.build() requirements = proj.get_requirements() info = proj.context.metadata config["markdown_extensions"] = requirements.markdown_extensions diff --git a/mknodes/plugin/mkdocsbackend.py b/mknodes/plugin/mkdocsbackend.py index e1d08f91..1e259dd4 100644 --- a/mknodes/plugin/mkdocsbackend.py +++ b/mknodes/plugin/mkdocsbackend.py @@ -163,4 +163,5 @@ def add_template(self, template: pagetemplate.PageTemplate): build_fn=paths.DEFAULT_BUILD_FN, clone_depth=1, ) + proj.build() reqs = proj.get_requirements() diff --git a/mknodes/project.py b/mknodes/project.py index 60622b60..d09aaa9b 100644 --- a/mknodes/project.py +++ b/mknodes/project.py @@ -101,24 +101,28 @@ def for_mknodes(cls, config=None) -> Project: from mknodes import mkdocsconfig config = mkdocsconfig.Config(config) - return cls( + kls = cls( base_url=config.site_url or "", use_directory_urls=config.use_directory_urls, theme=theme_.Theme.get_theme(config.theme.name, data=config.theme._vars), build_fn=config.plugins["mknodes"].config.build_fn, ) + kls.build() + return kls @classmethod def for_path(cls, path: str, config=None) -> Project: from mknodes import mkdocsconfig config = mkdocsconfig.Config(config) - return cls( + kls = cls( base_url=config.site_url or "", use_directory_urls=config.use_directory_urls, theme=theme_.Theme.get_theme(config.theme.name, data=config.theme._vars), repo=folderinfo.FolderInfo.clone_from(path), ) + kls.build() + return kls def set_root(self, nav: mknav.MkNav): self._root = nav