# How can I edit the tags page of a specific contents page

**URL:** <https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497>\
**Category:** support\
**Tags:** taxonomy\
**Created:** [February 25, 2024, 5:57pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497 "2024-02-25T17:57:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Applethal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/applethal/32/21434_2.png) [@Applethal](https://discourse.gohugo.io/u/Applethal)\
**Post date:** [February 25, 2024, 5:57pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/1 "2024-02-25T17:57:54Z")

</div>

Hello. I have my a Hugo setup with nested contents folder where my contents folder has 4 categories, one of which has a couple of subcategories.

Since each of these subcategories has its own design and posts, I want to be able to edit the tags page instead of having a default one that goes for all the categories. I tried to create a tags folder for one of the subcategories with a list.html file but that didn’t help.

---

<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:** [February 25, 2024, 6:00pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/2 "2024-02-25T18:00:32Z")

</div>

If you haven’t already done so, please read this:  
[https://gohugo.io/templates/lookup-order/](https://gohugo.io/templates/lookup-order/)

If you need additional assistance, please post a link to the public repository for your project.

See [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132).

> Let us see your code
> 
> Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
> 
> If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

---

<div class="post-metadata">

**Author:** ![Applethal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/applethal/32/21434_2.png) [@Applethal](https://discourse.gohugo.io/u/Applethal)\
**Post date:** [February 25, 2024, 6:31pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/3 "2024-02-25T18:31:44Z")

</div>

Hello, thanks for the links!

> **[GitHub - Applethal/mysite](https://github.com/Applethal/mysite)**
>
> Contribute to Applethal/mysite development by creating an account on GitHub.

I want the displayed posts to look differently if someone would click on a given tag in recommendations/recipes

---

<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:** [February 25, 2024, 6:58pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/4 "2024-02-25T18:58:03Z")

</div>

I’ll look at this in more detail in a few minutes, but you might want to read this:  
[https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center)

---

<div class="post-metadata">

**Author:** ![Applethal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/applethal/32/21434_2.png) [@Applethal](https://discourse.gohugo.io/u/Applethal)\
**Post date:** [February 25, 2024, 7:03pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/5 "2024-02-25T19:03:33Z")

</div>

Thanks a lot! yeah I am lazy hence why I was into using the forbidden center 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:** [February 25, 2024, 7:10pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/6 "2024-02-25T19:10:50Z")

</div>

When I build your site…

> ERROR render of “taxonomy” failed: “/home/jmooring/temp/mysite/layouts/tags/list.html:17:39”: execute of template failed: template: tags/list.html:17:39: executing “main” at \<.File.BaseFileName\>: error calling BaseFileName: runtime error: invalid memory address or nil pointer dereference  
> Total in 133 ms  
> Error: error building site: render: failed to render pages: render of “taxonomy” failed: “/home/jmooring/temp/mysite/layouts/tags/list.html:17:39”: execute of template failed: template: tags/list.html:17:39: executing “main” – File is nil; wrap it in if or with: {{ with .File }}{{ .BaseFileName }}{{ end }}

There are so many things wrong here I’m not even sure where to begin.

No:

```plaintext
content/blog/
├── Blog_post.png
├── _index.html
├── about.md
├── about.png
├── adnane.md
├── adnane.png
├── autobiography.md
└── blog_post.md

```

Yes (use page bundles):

```auto
content/blog/
├── about/
│ ├── cover.png
│ └── index.md
├── adnane/
│ ├── cover.png
│ └── index.md
├── blog_post/
│ ├── cover.png
│ └── index.md
├── _index.html
└── autobiography.md

```

No:

```auto
<div class="postpicture">
    <img src="/{{ .File.BaseFileName }}.png">
</div>

```

Yes (capture the bundled resource):

```plaintext
<div class="postpicture">
  {{ with .Resources.Get "cover.*" }}
    <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
  {{ end }}
</div>

```

I suggest you get the basics working before worrying about the rest.

---

<div class="post-metadata">

**Author:** ![Applethal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/applethal/32/21434_2.png) [@Applethal](https://discourse.gohugo.io/u/Applethal)\
**Post date:** [February 25, 2024, 7:16pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/7 "2024-02-25T19:16:33Z")

</div>

Thanks, I will try to adapt this to my workflow.

I am new to hugo though, everything that I could acomplish so far was just by googling things out. Also, are we on the same hugo version ? because I could build my site after cloning the repo and had no errors.

---

<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:** [February 25, 2024, 7:17pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/8 "2024-02-25T19:17:59Z")

</div>

I’m using the latest version, as should you.

---

<div class="post-metadata">

**Author:** ![Applethal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/applethal/32/21434_2.png) [@Applethal](https://discourse.gohugo.io/u/Applethal)\
**Post date:** [February 25, 2024, 7:44pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/9 "2024-02-25T19:44:44Z")

</div>

Hello again, yes we were few updates away from each other and your new code wouldn’t work on mine so I had to update. Thanks a lot! I will push the updates on my github later. How do I work on the tags page of recommendations/recipes ?

---

<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:** [February 25, 2024, 10:09pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/10 "2024-02-25T22:09:35Z")

</div>

I would be happy to help with that once you push your updates to Github.

---

<div class="post-metadata">

**Author:** ![IAPK](https://avatars.discourse-cdn.com/v4/letter/i/e9c0ed/32.png) [@IAPK](https://discourse.gohugo.io/u/IAPK)\
**Post date:** [March 2, 2024, 3:41pm UTC](https://discourse.gohugo.io/t/how-can-i-edit-the-tags-page-of-a-specific-contents-page/48497/11 "2024-03-02T15:41:01Z")

</div>

Hi Applethal, ensure you’re structuring your content correctly. Create a tags folder within the relevant subcategory’s folder, within this tags folder, place a list.html file for customization. If the default structure isn’t working, check your theme’s documentation or modify the theme to support your desired structure. Furthermore, test your changes to ensure the tags page displays as intended for the specific subcategory.
