My goal is to get access to all the stuff in the frontmatter of the project file. However, that .Page.Params isn’t giving me that. What I get instead looks like:
map[draft:false iscjklanguage:false title:Community Music Sarajevo]
Clearly, at some point in the process, I’m able to access the parameters loaded from the frontmatter because I use them successfully to select pages in the where clause. But if I try to get a Page from a WeightedPage then those parameters become mysteriously unreachable.
Mysteriously to me, at least. I suspect that the root problem is that there’s some part of Hugo’s data representation that I don’t understand correctly. But I’d welcome any tips that anyone could give me on figuring out the correct way to access the information I need in this case.
Before I get to your original question, I just want to make sure that you understand there’s a potential for page collisions here. Your content pages will render to the /public/projects directory, but so will your term pages within the “projects” taxonomy.
This is interesting. I think I’m using taxonomies wrong, and that projects should not be a taxonomy. And I suspect I’m already getting bitten by the collision issue you mentioned.
It sounds as if I should remove the projects taxonomy altogether.
The issue is that I was using taxonomies in a way that they are not designed to be used. The overlap between the taxonomy and the page hierarchy produced two problems. One was technical: collisions meant that pages at specific paths were sometimes rendered with one template, sometimes with a different one, seemingly at random. The other was conceptual: because I was thinking of taxonomy pages as pages (because I had a parallel page hierarchy that corresponded exactly to the taxonomy hierarchy) I expected to be able to get ‘page’ information – but I was accessing objects via Taxonomy and the generated taxonomy pages, naturally, had a different set of attached information.
The solution was to eliminate the project taxonomy type, which was not appropriate.