Skip to content

Commit

Permalink
Updated distribution files
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Apr 25, 2024
1 parent 04f177c commit 254ee97
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions material/plugins/tags/plugin.py
Expand Up @@ -97,8 +97,10 @@ def on_page_markdown(self, markdown, page, config, files):
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):
Expand All @@ -110,7 +112,8 @@ def on_page_context(self, context, page, config, nav):
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"]
Expand Down

0 comments on commit 254ee97

Please sign in to comment.