Taxonomy Page Resources

#1

I am currently trying to work out if I can use page resources with a taxonomy.

I tried following this guide on how to create front-matter for a taxonomy but this only allows for text front matter, page resources are not returned. If I create the folder /content/categories/category/ I am able to get page resources returned.

Is there an official way to do this? All of my other pages are setup to use page resources and would prefer to stick with that.

#2

The simplest way to do what you ask is to have the page resources organized reside under the assetsDir of your project and fetch them on taxonomy lists (and any other page) with the method resource.Get.

#3

Thank you for your response @onedrawingperday.

I solve this by creating a separate section to the posts section. I then created pages within this section for the taxonomy pages I wanted. I configured the pages front matter to have the same taxonomy (in my case category) as the taxonomy they were connected to. I then wrote some Go to get related pages by category.

Doing this allowed me to use page resources for the categories I wanted and allowed me to bypass the restriction of page resources not being available for taxonomies.