Add description to taxonomy "tags" term

I want to be able to display a description when on the page for a term / tag.

So I have a “Story Seed” tag setup like

/tags/story-seed/

And in content\tags\story-seed\_index.md I have a description set

---
description: "Example description."
---

How do I get the description to show up on the page when going to that tag?

What I want

s2

hi! which theme do you use? this is may be it’s logic.

PaperMod

I did not see anything obvious in its FAQ. I am still a beginner with Hugo.

content/tags/story-seed/_index.md

---
title: "Story Seed"
date: 2021-02-23T10:10:49-08:00
draft: false
description: Example description.
---

This works fine. Make sure draft is set to false.

3 Likes

That does work. Thank you!

A related question - how do I add links to the description text so that they appear properly? I tried HTML and Markdown but both printed as is, as plain text without a functional link.

From the root of your hugo project:

mkdir layouts/_default
cp themes/PaperMod/layouts/_default/list.html layouts/_default/

Then edit line 13 of layouts/_default/list.html. Change:

{{ .Description }}

to:

{{ .Description | .Page.RenderString }}

And content/tags/story-seed/_index.md should look something like:

---
title: "Story Seed"
date: 2021-02-23T10:10:49-08:00
draft: false
description: This is [a link to Hugo](https://gohugo.io/).
---

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.