Material Design theme for MkDocs with built-in plugins for blogs, search, social cards, and privacy compliance
—
Tag-based content organization with automatic tag pages, tag clouds, and tag-based navigation. The tags plugin enables content discovery through topic-based categorization, creating an intuitive taxonomy system for documentation.
Core tags configuration that enables tag-based content organization and automatic tag page generation.
plugins:
- material/tags:
enabled: true # Enable tags plugin (default: true)
tags: true # Generate tag functionality (default: true)
tags_slugify: !!python/name:pymdownx.slugs.slugify # Tag slug generation
tags_slugify_separator: "-" # Tag slug separator
tags_allowed: [] # Allowed tags list (empty = all allowed)Customizable tag index page with listing and organization options.
plugins:
- material/tags:
tags_file: tags.md # Tag index file path
tags_name: "Tags" # Tag index page name
tags_template: "tags.html" # Custom tag template
tags_hierarchy: true # Enable hierarchical tags
tags_slugify: !!python/name:pymdownx.slugs.slugify
tags_slugify_separator: "-" # Tag slug separatorIndividual tag pages showing all content with specific tags.
plugins:
- material/tags:
tags_extra_files:
compatibility.md:
- compatibility # Tag file mapping
web.md:
- html
- css
- javascript
tags_allowed: [] # Restricted tag list (empty = all allowed)Tag visual presentation and styling options.
plugins:
- material/tags:
tags_compare: case_sensitive # Tag comparison mode
tags_compare_reverse: false # Reverse tag comparison
tags_hierarchy: false # Hierarchical tag displayplugins:
- material/tags:
tags_file: tags.mdplugins:
- material/tags:
tags_file: reference/tags.md
tags_extra_files:
api.md:
- api
- reference
tutorials.md:
- tutorial
- guide
examples.md:
- example
- demo
tags_allowed:
- api
- tutorial
- guide
- reference
- example
- demo
- advanced
- beginnerplugins:
- material/tags:
tags_file: tags.md
tags_hierarchy: true
tags_slugify: !!python/name:pymdownx.slugs.slugify
tags_compare: case_insensitiveplugins:
- material/tagsAdd tags to individual pages using frontmatter metadata.
---
title: Getting Started Guide
tags:
- tutorial
- beginner
- setup
- installation
---
# Getting Started Guide
This guide will help you get started...---
# Single tag
tags: tutorial
# Multiple tags (list format)
tags:
- tutorial
- api
- advanced
# Multiple tags (inline format)
tags: [tutorial, api, advanced]
---Create a dedicated tags index page to display all available tags and their associated content.
---
template: tags.html
title: Tags
---
# Tags
Explore content by topic using the tags below.---
title: Documentation Tags
---
# Content by Topic
Browse our documentation by category:
## API Documentation
- [API Reference](../api/) `api` `reference`
- [Authentication](../auth/) `api` `auth` `security`
## Tutorials
- [Getting Started](../getting-started/) `tutorial` `beginner`
- [Advanced Usage](../advanced/) `tutorial` `advanced`
## Examples
- [Code Examples](../examples/) `example` `demo`
- [Use Cases](../use-cases/) `example` `tutorial`Control how tags appear on pages and in navigation.
theme:
name: material
features:
- content.tags.link # Enable tag linksTags automatically inherit theme colors and can be styled with CSS:
.md-tag {
background-color: var(--md-primary-fg-color);
color: var(--md-primary-bg-color);
}
.md-tag:hover {
background-color: var(--md-accent-fg-color);
}Organize tags hierarchically for better content structure.
---
tags:
- programming/python
- programming/web
- framework/django
- level/intermediate
---plugins:
- material/tags:
tags_allowed:
- programming/python
- programming/javascript
- programming/web
- framework/django
- framework/react
- level/beginner
- level/intermediate
- level/advancedclass TagsPlugin(BasePlugin[TagsConfig]):
"""Tags plugin for content organization and discovery."""
supports_multiple_instances = True
def on_startup(self, *, command, **kwargs) -> None:
"""Initialize tags plugin on startup."""
def on_config(self, config: MkDocsConfig) -> None:
"""Configure tags plugin settings."""
@event_priority(-50)
def on_page_markdown(self, markdown: str, *, page: Page, config: MkDocsConfig, **kwargs) -> str:
"""Process page markdown for tag extraction."""
@event_priority(100)
def on_env(self, env: Environment, *, config: MkDocsConfig, **kwargs) -> None:
"""Configure template environment for tags."""
def on_page_context(self, context: TemplateContext, *, page: Page, **kwargs) -> None:
"""Add tag context to page rendering."""class TagsConfig(Config):
"""Configuration options for the tags plugin."""
enabled = Type(bool, default=True)
tags = Type(bool, default=True)
tags_file = Optional(Type(str))
tags_name = Type(str, default="Tags")
tags_template = Optional(Type(str))
tags_extra_files = Type(dict, default={})
tags_allowed = Type(list, default=[])
tags_compare = Choice(['case_sensitive', 'case_insensitive'], default='case_sensitive')
tags_compare_reverse = Type(bool, default=False)
tags_hierarchy = Type(bool, default=False)
tags_slugify = Type(callable, default=None)
tags_slugify_separator = Type(str, default='-')The plugin can generate tag clouds showing tag frequency and importance.
# Available in template context
tag_stats = {
'tutorial': {'count': 15, 'pages': [...]},
'api': {'count': 8, 'pages': [...]},
'example': {'count': 12, 'pages': [...]}
}<!-- Available in tags template -->
{{ tags }} <!-- List of all tags -->
{{ tag_stats }} <!-- Tag usage statistics -->
{{ pages_by_tag }} <!-- Pages organized by tag -->Install with Tessl CLI
npx tessl i tessl/pypi-mkdocs-material