mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-13 18:40:54 +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)
|
enabled = Type(bool, default = True)
|
||||||
|
|
||||||
# Settings for tags
|
# Settings for tags
|
||||||
|
tags = Type(bool, default = True)
|
||||||
tags_file = Optional(Type(str))
|
tags_file = Optional(Type(str))
|
||||||
tags_extra_files = Type(dict, default = {})
|
tags_extra_files = Type(dict, default = {})
|
||||||
tags_slugify = Type((type(slugify), partial), default = slugify)
|
tags_slugify = Type((type(slugify), partial), default = slugify)
|
||||||
|
@ -44,6 +44,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
|||||||
if not self.config.enabled:
|
if not self.config.enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip if tags should not be built
|
||||||
|
if not self.config.tags:
|
||||||
|
return
|
||||||
|
|
||||||
# Initialize tags
|
# Initialize tags
|
||||||
self.tags = defaultdict(list)
|
self.tags = defaultdict(list)
|
||||||
self.tags_file = None
|
self.tags_file = None
|
||||||
@ -66,6 +70,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
|||||||
if not self.config.enabled:
|
if not self.config.enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip if tags should not be built
|
||||||
|
if not self.config.tags:
|
||||||
|
return
|
||||||
|
|
||||||
# Resolve tags index page
|
# Resolve tags index page
|
||||||
file = self.config.tags_file
|
file = self.config.tags_file
|
||||||
if file:
|
if file:
|
||||||
@ -76,6 +84,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
|||||||
if not self.config.enabled:
|
if not self.config.enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip if tags should not be built
|
||||||
|
if not self.config.tags:
|
||||||
|
return
|
||||||
|
|
||||||
# Skip, if page is excluded
|
# Skip, if page is excluded
|
||||||
if page.file.inclusion.is_excluded():
|
if page.file.inclusion.is_excluded():
|
||||||
return
|
return
|
||||||
@ -93,6 +105,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
|||||||
if not self.config.enabled:
|
if not self.config.enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip if tags should not be built
|
||||||
|
if not self.config.tags:
|
||||||
|
return
|
||||||
|
|
||||||
# Provide tags for page
|
# Provide tags for page
|
||||||
if "tags" in page.meta:
|
if "tags" in page.meta:
|
||||||
context["tags"] = [
|
context["tags"] = [
|
||||||
|
@ -34,6 +34,7 @@ class TagsConfig(Config):
|
|||||||
enabled = Type(bool, default = True)
|
enabled = Type(bool, default = True)
|
||||||
|
|
||||||
# Settings for tags
|
# Settings for tags
|
||||||
|
tags = Type(bool, default = True)
|
||||||
tags_file = Optional(Type(str))
|
tags_file = Optional(Type(str))
|
||||||
tags_extra_files = Type(dict, default = {})
|
tags_extra_files = Type(dict, default = {})
|
||||||
tags_slugify = Type((type(slugify), partial), default = slugify)
|
tags_slugify = Type((type(slugify), partial), default = slugify)
|
||||||
|
@ -44,6 +44,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
|||||||
if not self.config.enabled:
|
if not self.config.enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip if tags should not be built
|
||||||
|
if not self.config.tags:
|
||||||
|
return
|
||||||
|
|
||||||
# Initialize tags
|
# Initialize tags
|
||||||
self.tags = defaultdict(list)
|
self.tags = defaultdict(list)
|
||||||
self.tags_file = None
|
self.tags_file = None
|
||||||
@ -66,6 +70,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
|||||||
if not self.config.enabled:
|
if not self.config.enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip if tags should not be built
|
||||||
|
if not self.config.tags:
|
||||||
|
return
|
||||||
|
|
||||||
# Resolve tags index page
|
# Resolve tags index page
|
||||||
file = self.config.tags_file
|
file = self.config.tags_file
|
||||||
if file:
|
if file:
|
||||||
@ -76,6 +84,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
|||||||
if not self.config.enabled:
|
if not self.config.enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip if tags should not be built
|
||||||
|
if not self.config.tags:
|
||||||
|
return
|
||||||
|
|
||||||
# Skip, if page is excluded
|
# Skip, if page is excluded
|
||||||
if page.file.inclusion.is_excluded():
|
if page.file.inclusion.is_excluded():
|
||||||
return
|
return
|
||||||
@ -93,6 +105,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
|
|||||||
if not self.config.enabled:
|
if not self.config.enabled:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip if tags should not be built
|
||||||
|
if not self.config.tags:
|
||||||
|
return
|
||||||
|
|
||||||
# Provide tags for page
|
# Provide tags for page
|
||||||
if "tags" in page.meta:
|
if "tags" in page.meta:
|
||||||
context["tags"] = [
|
context["tags"] = [
|
||||||
|
Loading…
Reference in New Issue
Block a user