Tags¶
Zensical adds first-class support for categorizing pages with tags, which allows users to discover related pages via search. If your documentation is large, tags can help users find relevant information faster.
Configuration¶
Zensical provides a native implementation of the tags plugin, adapted from the configuration and behavior of the Material for MkDocs tags plugin. Enable it in your configuration:
The implementation supports the existing plugin configuration, including tag listings and advanced tag settings. Refer to the original plugin documentation for all available options and listing syntax, and check the compatibility entry for Zensical-specific information.
Tag icons and identifiers¶
Each tag can be associated with an icon, which is rendered inside the tag. Before assigning icons to tags, associate each tag with a unique identifier by adding the following to your configuration:
The identifier can only include alphanumeric characters, as well as dashes and underscores. For example, if you have a tag Compatibility, you can set compat as an identifier:
Identifiers can be reused between tags to assign groups of tags the same icon. Tags that are not explicitly associated with an identifier will use the default tag icon.
Next, each identifier can be associated with an icon, including a custom icon, under the theme.icon configuration setting:
Expand to see an example
Usage¶
Add tags¶
Tags can be added to a document with the front matter tags property. They can also be used in search without any further configuration. Add the following lines at the top of a Markdown file:
The page will now render with those tags at the bottom, and users will be able to filter by them in search.
Hide tags on a page¶
While tags are rendered at the bottom of each page, you can hide them for a specific page with the front matter hide property: