1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-12 01:50:52 +01:00

Updated distribution files

This commit is contained in:
squidfunk 2024-04-25 09:35:26 +07:00
parent 04f177cbd4
commit 254ee97473
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF

View File

@ -97,8 +97,10 @@ class TagsPlugin(BasePlugin[TagsConfig]):
return self._render_tag_index(markdown)
# Add page to tags index
for tag in page.meta.get("tags", []):
self.tags[tag].append(page)
tags = page.meta.get("tags", [])
if tags:
for tag in tags:
self.tags[tag].append(page)
# Inject tags into page (after search and before minification)
def on_page_context(self, context, page, config, nav):
@ -110,7 +112,8 @@ class TagsPlugin(BasePlugin[TagsConfig]):
return
# Provide tags for page
if "tags" in page.meta:
context["tags"] =[]
if "tags" in page.meta and page.meta["tags"]:
context["tags"] = [
self._render_tag(tag)
for tag in page.meta["tags"]