Xanthan includes a built-in tagging system that makes it easy to organize and filter content across your site. The system is designed to be simple, requiring only YAML frontmatter tags on your pages and a single tags page. This page describes how tagging works, and you can see it work on our sample tag page.
Add tags to any page’s YAML frontmatter:
---
title: Forest
layout: scrollstory
tags:
- music
- nature
- campus
---
Tags are case-insensitive and can contain spaces. Keep them simple and consistent for best results.
The tags page (/tags/) is configured in its frontmatter:
---
layout: base
title: Tags
summary: Browse by tags
permalink: /tags/
tag-folders: scrollstories
---
The tag-folders parameter tells the page which folder(s) to collect tags from. You can specify a single folder or multiple comma-separated folders.
The page automatically:
?tag=music to show only matching pagesShare direct links to filtered views:
/tags/ - Shows all pages/tags/?tag=music - Shows only pages tagged “music”/tags/?tag=history - Shows only pages tagged “history”Users can click tag badges on the tags page, or you can link directly to filtered views from anywhere on your site.
By default, the tags page looks for pages in /scrollstories/. To change this, edit the tag-folders parameter in the frontmatter of tags.md:
Single folder:
---
layout: base
title: Tags
permalink: /tags/
tag-folders: scrollstories
---
Change scrollstories to your preferred folder, like essays or projects.
Multiple folders:
---
layout: base
title: Tags
permalink: /tags/
tag-folders: scrollstories, essays, projects
---
Use a comma-separated list to collect tags from multiple folders. The page will show all tagged content from any of the specified folders.
You can create multiple tag pages for different content collections:
Example: /project-tags.md
---
layout: base
title: Project Tags
permalink: /project-tags/
tag-folders: projects
---
Example: /all-tags.md (multiple content types)
---
layout: base
title: All Tags
permalink: /all-tags/
tag-folders: scrollstories, essays, projects
---
Tag styles are defined in assets/css/cards.css:
.tag-pill - Small tags shown on cards.tag-badge - Large clickable filter tags.tag-badge.active - Currently selected filter.tag-list - Container for filter badgesCustomize colors, sizes, and hover effects by editing these classes.
The card grid automatically displays tags when present:
{% include nav/card-grid.html cards=site.pages show-tags=true %}
To hide tags on specific card grids:
{% include nav/card-grid.html cards=site.pages show-tags=false %}
Display tag pills anywhere on your site:
Static tag (display only):
<span class="tag-pill">music</span>
music
Clickable tag (links to filtered view):
<a href="/tags/?tag=music" class="tag-pill">music</a>
Use clickable tags to help readers discover related content. Replace music with any tag from your site.
Good tags: music, history, nature, campus, architecture
Avoid: This is about music history, MUSIC, Music123
Add tag filters to your main navigation by editing _data/top-nav.yml:
- title: "Browse"
items:
- title: "All Stories"
url: "/tags/"
- title: "Music"
url: "/tags/?tag=music"
- title: "History"
url: "/tags/?tag=history"
- title: "Nature"
url: "/tags/?tag=nature"
Tags aren’t showing up
tags: in frontmatter (not tag:)Filtering doesn’t work
Cards look wrong
assets/css/cards.css is loadedthumbnail or header-image in frontmatter