How to add text content to category list page?


I want to add a block of text content to the top of a specific category list page.
I have looked for some documentation or guidance, but have found none.
Could anyone assist, please?


Let’s say you have a recipe site with the following categories: breakfast, lunch, dinner.

To add some content to the top of the breakfast listing:

hugo new categories/breakfast/

Assuming your list page prints {{ .Content }} in addition to ranging through pages, whatever markdown you add to content/categories/breakfast/ will appear at the top of list page.

1 Like

@jmooring I was trying to figure that out last night :laughing:

An alternative …
I ended up using params in the front matter as this was being used for meta-description in the HTML

Thanks, amigos.
I’ll get a go at that later.

Yes, this solution works perfectly.
Thanks for the added tip of having {{ .Content }} in the page also.
That would have done my head in otherwise :laughing:

Thanks very much!

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