# Associate a description with a tag

**URL:** <https://discourse.gohugo.io/t/associate-a-description-with-a-tag/50112>\
**Category:** support\
**Tags:** taxonomy\
**Created:** [June 1, 2024, 4:25pm UTC](https://discourse.gohugo.io/t/associate-a-description-with-a-tag/50112 "2024-06-01T16:25:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mesh2325](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mesh2325/32/22242_2.png) [@mesh2325](https://discourse.gohugo.io/u/mesh2325)\
**Post date:** [June 1, 2024, 4:25pm UTC](https://discourse.gohugo.io/t/associate-a-description-with-a-tag/50112/1 "2024-06-01T16:25:34Z")

</div>

Is there a way to associate a description with a specific tag? Basically, on the tag list page, I want to show the tag name and tag description.

I saw this post:  
[https://discourse.gohugo.io/t/add-description-to-taxonomy-tags-term/31388/7](https://discourse.gohugo.io/t/add-description-to-taxonomy-tags-term/31388/7)

which does it by creating a template for each tag,and adding the description to the template, but I am trying to figure out if there is a central place (config?) I could define the data so I could use a single template, and not create a new template every time I add a tag.

I could probably also use a single template, and then write code to show description based on tag, but again, I was looking for a simpler solution to maintain.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 1, 2024, 4:36pm UTC](https://discourse.gohugo.io/t/associate-a-description-with-a-tag/50112/2 "2024-06-01T16:36:36Z")

</div>

[https://gohugo.io/content-management/taxonomies/#add-custom-metadata-to-a-taxonomy-or-term](https://gohugo.io/content-management/taxonomies/#add-custom-metadata-to-a-taxonomy-or-term)

content directory

```plaintext
content/
├── posts/
│ ├── _index.md
│ └── post-1.md
├── tags/
│ └── tag-a/
│ └── _index.md
└── _index.md

```

content/tags/tag-a/\_index.md

```plaintext
+++
title = 'Tag A'
date = 2024-06-01T09:29:49-07:00
draft = false
+++
This is the description of Tag A.

```

layouts directory

```plaintext
layouts/
└── _default/
    ├── baseof.html
    ├── home.html
    ├── list.html
    ├── single.html
    ├── taxonomy.html
    └── term.html

```

layouts/\_default/term.html

```plaintext
{{ define "main" }}
  <h1>{{ .Title }}</h1>
  {{ .Content }}
  {{ range .Pages }}
    <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
    {{ with .Content }}
      {{ . }}
    {{ end }}
  {{ end }}
{{ end }}

```

---

<div class="post-metadata">

**Author:** ![mesh2325](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mesh2325/32/22242_2.png) [@mesh2325](https://discourse.gohugo.io/u/mesh2325)\
**Post date:** [June 1, 2024, 5:34pm UTC](https://discourse.gohugo.io/t/associate-a-description-with-a-tag/50112/3 "2024-06-01T17:34:07Z")

</div>

ok. Just to make sure im reading this right, I need to create a page for each tag.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 1, 2024, 6:01pm UTC](https://discourse.gohugo.io/t/associate-a-description-with-a-tag/50112/4 "2024-06-01T18:01:48Z")

</div>

If you want a description specific to a given tag, then you need to create a page for that tag.

---

<div class="post-metadata">

**Author:** ![mesh2325](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mesh2325/32/22242_2.png) [@mesh2325](https://discourse.gohugo.io/u/mesh2325)\
**Post date:** [June 1, 2024, 10:23pm UTC](https://discourse.gohugo.io/t/associate-a-description-with-a-tag/50112/5 "2024-06-01T22:23:38Z")

</div>

Thank you for confirming.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [June 3, 2024, 10:23pm UTC](https://discourse.gohugo.io/t/associate-a-description-with-a-tag/50112/6 "2024-06-03T22:23:39Z")

</div>

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