1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-27 17:00:54 +01:00

Fixed draft blog posts being included in navigation

This commit is contained in:
squidfunk 2023-09-13 22:05:53 +02:00
parent ae93496d6b
commit ef5a04a324
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
2 changed files with 6 additions and 8 deletions

View File

@ -134,10 +134,6 @@ class BlogPlugin(BasePlugin[BlogConfig]):
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 @@ class BlogPlugin(BasePlugin[BlogConfig]):
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

View File

@ -134,10 +134,6 @@ class BlogPlugin(BasePlugin[BlogConfig]):
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 @@ class BlogPlugin(BasePlugin[BlogConfig]):
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