I have collections set up for a couple different primary tags, and I’m trying to figure out how to paginate only within the context of that collection when viewing a post. The official docs suggest that I can use {{#prev_post in="primary_tag"}}
, although it doesn’t actually work—it still traverses posts with any tag.
Here’s my setup:
routes.yaml
collections:
/food/:
permalink: /food/{slug}/
template: category-food
filter: primary_tag:food
taxonomies:
tag: /{slug}/
post.hbs
{{#post}}
<h1>{{title}}</h1>
{{content}}
{{#prev_post in="primary_tag:food"}}
<a href="{{url}}">
Previous
{{title}}
{{primary_tag.name}}
</a>
{{/prev_post}}
{{#next_post in="primary_tag:food"}}
<a href="{{url}}">
Next
{{title}}
{{primary_tag.name}}
</a>
{{/next_post}}
{{/post}}
I’ve also tried food
instead of primary_tag:food
as the filter, but neither seems to have any effect. Am I doing something wrong here, or is it impossible to filter pagination within a collection?