subsoap
February 23, 2021, 6:48am
1
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
snayp
February 23, 2021, 7:34am
2
hi! which theme do you use? this is may be it’s logic.
subsoap
February 23, 2021, 7:47am
3
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
subsoap
February 23, 2021, 6:41pm
5
That does work. Thank you!
subsoap
February 23, 2021, 8:13pm
6
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
system
Closed
February 26, 2021, 12:27am
8
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.