Skip to content

Commit

Permalink
Fixed draft blog posts being included in navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Sep 13, 2023
1 parent ae93496 commit ef5a04a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions material/plugins/blog/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/plugins/blog/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ef5a04a

Please sign in to comment.