diff --git a/material/plugins/blog/plugin.py b/material/plugins/blog/plugin.py index 634c57f2f93..4f4d9c69c4f 100644 --- a/material/plugins/blog/plugin.py +++ b/material/plugins/blog/plugin.py @@ -134,10 +134,6 @@ def on_files(self, files, *, config): reverse = True ) - # Temporarily remove posts from navigation - for post in self.blog.posts: - post.file.inclusion = InclusionLevel.EXCLUDED - # Generate views for archive if self.config.archive: views = self._generate_archive(config, files) @@ -460,6 +456,9 @@ def _resolve_posts(self, files: Files, config: MkDocsConfig): if not file.src_path.startswith(path): continue + # Temporarily remove post from navigation + file.inclusion = InclusionLevel.EXCLUDED + # Resolve post - in order to determine whether a post should be # excluded, we must load it and analyze its metadata. All posts # marked as drafts are excluded, except for when the author has diff --git a/src/plugins/blog/plugin.py b/src/plugins/blog/plugin.py index 634c57f2f93..4f4d9c69c4f 100644 --- a/src/plugins/blog/plugin.py +++ b/src/plugins/blog/plugin.py @@ -134,10 +134,6 @@ def on_files(self, files, *, config): reverse = True ) - # Temporarily remove posts from navigation - for post in self.blog.posts: - post.file.inclusion = InclusionLevel.EXCLUDED - # Generate views for archive if self.config.archive: views = self._generate_archive(config, files) @@ -460,6 +456,9 @@ def _resolve_posts(self, files: Files, config: MkDocsConfig): if not file.src_path.startswith(path): continue + # Temporarily remove post from navigation + file.inclusion = InclusionLevel.EXCLUDED + # Resolve post - in order to determine whether a post should be # excluded, we must load it and analyze its metadata. All posts # marked as drafts are excluded, except for when the author has