mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-30 18:24:35 +01:00
Fixed draft blog posts being included in navigation
This commit is contained in:
parent
ae93496d6b
commit
ef5a04a324
@ -134,10 +134,6 @@ class BlogPlugin(BasePlugin[BlogConfig]):
|
|||||||
reverse = True
|
reverse = True
|
||||||
)
|
)
|
||||||
|
|
||||||
# Temporarily remove posts from navigation
|
|
||||||
for post in self.blog.posts:
|
|
||||||
post.file.inclusion = InclusionLevel.EXCLUDED
|
|
||||||
|
|
||||||
# Generate views for archive
|
# Generate views for archive
|
||||||
if self.config.archive:
|
if self.config.archive:
|
||||||
views = self._generate_archive(config, files)
|
views = self._generate_archive(config, files)
|
||||||
@ -460,6 +456,9 @@ class BlogPlugin(BasePlugin[BlogConfig]):
|
|||||||
if not file.src_path.startswith(path):
|
if not file.src_path.startswith(path):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# Temporarily remove post from navigation
|
||||||
|
file.inclusion = InclusionLevel.EXCLUDED
|
||||||
|
|
||||||
# Resolve post - in order to determine whether a post should be
|
# Resolve post - in order to determine whether a post should be
|
||||||
# excluded, we must load it and analyze its metadata. All posts
|
# excluded, we must load it and analyze its metadata. All posts
|
||||||
# marked as drafts are excluded, except for when the author has
|
# marked as drafts are excluded, except for when the author has
|
||||||
|
@ -134,10 +134,6 @@ class BlogPlugin(BasePlugin[BlogConfig]):
|
|||||||
reverse = True
|
reverse = True
|
||||||
)
|
)
|
||||||
|
|
||||||
# Temporarily remove posts from navigation
|
|
||||||
for post in self.blog.posts:
|
|
||||||
post.file.inclusion = InclusionLevel.EXCLUDED
|
|
||||||
|
|
||||||
# Generate views for archive
|
# Generate views for archive
|
||||||
if self.config.archive:
|
if self.config.archive:
|
||||||
views = self._generate_archive(config, files)
|
views = self._generate_archive(config, files)
|
||||||
@ -460,6 +456,9 @@ class BlogPlugin(BasePlugin[BlogConfig]):
|
|||||||
if not file.src_path.startswith(path):
|
if not file.src_path.startswith(path):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# Temporarily remove post from navigation
|
||||||
|
file.inclusion = InclusionLevel.EXCLUDED
|
||||||
|
|
||||||
# Resolve post - in order to determine whether a post should be
|
# Resolve post - in order to determine whether a post should be
|
||||||
# excluded, we must load it and analyze its metadata. All posts
|
# excluded, we must load it and analyze its metadata. All posts
|
||||||
# marked as drafts are excluded, except for when the author has
|
# marked as drafts are excluded, except for when the author has
|
||||||
|
Loading…
Reference in New Issue
Block a user