Not sure if this is possible, but here goes:
I’m trying to create a series of “primary tag” pages that show posts with the given primary tag, but grouped by secondary tags of my choosing.
I have currently got this going using a combination of routes and hard-coded templates. E.g
// my routes.yaml:
routes:
/features/:
template: features
//----
// features.hbs
{{#get "tags" slug="features" include='count.posts' as |tag| }}
{{#tag}}
<h1>{{name}}</h1>
{{> "primary-tag-section" primary_tag="features" secondary_tag="interviews"}}
{{> "primary-tag-section" primary_tag="features" secondary_tag="adventures"}}
My primary-tag-section
partial then outputs posts and secondary tag details based on the two variables passed in.
Is there any way I could configure the page directly via routes.yaml?
e.g.
routes:
/features/:
template: primary-tag-page
data:
primary_tag: features
secondary_tags:
- interviews
- adventures
/something/:
template: primary-tag-page
data:
primary_tag: something
secondary_tags:
- tag-2
- tag3