mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-12 01:50:52 +01:00
Added missing tags setting in tags plugin
This commit is contained in:
parent
2a131caad6
commit
e3d5fd2eb3
@ -34,6 +34,7 @@ class TagsConfig(Config):
|
||||
enabled = Type(bool, default = True)
|
||||
|
||||
# Settings for tags
|
||||
tags = Type(bool, default = True)
|
||||
tags_file = Optional(Type(str))
|
||||
tags_extra_files = Type(dict, default = {})
|
||||
tags_slugify = Type((type(slugify), partial), default = slugify)
|
||||
|
@ -44,6 +44,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# Skip if tags should not be built
|
||||
if not self.config.tags:
|
||||
return
|
||||
|
||||
# Initialize tags
|
||||
self.tags = defaultdict(list)
|
||||
self.tags_file = None
|
||||
@ -66,6 +70,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# Skip if tags should not be built
|
||||
if not self.config.tags:
|
||||
return
|
||||
|
||||
# Resolve tags index page
|
||||
file = self.config.tags_file
|
||||
if file:
|
||||
@ -76,6 +84,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# Skip if tags should not be built
|
||||
if not self.config.tags:
|
||||
return
|
||||
|
||||
# Skip, if page is excluded
|
||||
if page.file.inclusion.is_excluded():
|
||||
return
|
||||
@ -93,6 +105,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# Skip if tags should not be built
|
||||
if not self.config.tags:
|
||||
return
|
||||
|
||||
# Provide tags for page
|
||||
if "tags" in page.meta:
|
||||
context["tags"] = [
|
||||
|
@ -34,6 +34,7 @@ class TagsConfig(Config):
|
||||
enabled = Type(bool, default = True)
|
||||
|
||||
# Settings for tags
|
||||
tags = Type(bool, default = True)
|
||||
tags_file = Optional(Type(str))
|
||||
tags_extra_files = Type(dict, default = {})
|
||||
tags_slugify = Type((type(slugify), partial), default = slugify)
|
||||
|
@ -44,6 +44,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# Skip if tags should not be built
|
||||
if not self.config.tags:
|
||||
return
|
||||
|
||||
# Initialize tags
|
||||
self.tags = defaultdict(list)
|
||||
self.tags_file = None
|
||||
@ -66,6 +70,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# Skip if tags should not be built
|
||||
if not self.config.tags:
|
||||
return
|
||||
|
||||
# Resolve tags index page
|
||||
file = self.config.tags_file
|
||||
if file:
|
||||
@ -76,6 +84,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# Skip if tags should not be built
|
||||
if not self.config.tags:
|
||||
return
|
||||
|
||||
# Skip, if page is excluded
|
||||
if page.file.inclusion.is_excluded():
|
||||
return
|
||||
@ -93,6 +105,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# Skip if tags should not be built
|
||||
if not self.config.tags:
|
||||
return
|
||||
|
||||
# Provide tags for page
|
||||
if "tags" in page.meta:
|
||||
context["tags"] = [
|
||||
|
Loading…
Reference in New Issue
Block a user