Hi,
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?
Thanks,
Kai
Hi,
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?
Thanks,
Kai
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/_index.md
Assuming your list page prints {{ .Content }}
in addition to ranging through pages, whatever markdown you add to content/categories/breakfast/_index.md
will appear at the top of list page.
@jmooring I was trying to figure that out last night
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
Thanks very much!
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.