I wonder what’s wrong with this code?
routes:
collections:
/:
permalink: /{slug}/
filter: tag:-music
/music/:
permalink: /music/{slug}/
filter: tag:music
/quotes/:
permalink: /quotes/{slug}/
filter: tag:quotes
taxonomies:
tag: /tags/{slug}/
author: /writers/{slug}/
(Also tried tag:-[music]
, it’s not working as expected).
The expected behavior is that index collection hide tags from music
(and quotes
but I can’t get a single tag out).
I’m currently using #get
before #foreach posts
as a workaround and the post lists are OK but the navigation between them is not.
I hope to found an elegant, clear and simple solution using yaml files (:
Thanks for your time.
This setup has the / route getting everything except music, the music route getting music, and the quotes route getting nothing, because every post either has music or doesn’t. Your / route allows quotes, so you’re getting quotes there. Try instead for the / route:
tags:-[music,quotes]
Or reorder your tags so that the / route is last.
Posts belong to no more than one collection and are assigned in order.
1 Like
Which theme? Source I’ve read plenty doesnt obey many of these.
Can we remove routes and only use collections on that case?
Already tried your code using only collections without success.
Now I wonder if that’s a limitation on the core or something wrong with my Ghost instance 
collections:
/:
permalink: /{slug}/
filter: tags:-[music,quotes]
/music/:
permalink: /music/{slug}/
filter: tag:music
/quotes/:
permalink: /quotes/{slug}/
filter: tag:quotes
Tried to filter on the pagination as well. I don’t really know if that’s possible (of course, I’m not a dev!)
{{^has tag="quotes,music"}}
<aside class="navigation-section global-padding">
<div class="navigation-wrap">
{{#next_post filter="tags:-[music,quotes]"}}
<a href="{{url}}" class="navigation-next">
{{#if feature_image}}
<div class="navigation-image global-image global-radius">
{{>images/other_image other_image=feature_image alt=""}}
</div>
{{/if}}
<div class="navigation-content">
<small>{{t "Newer post"}}</small>
<br>
<h3>{{title}}</h3>
</div>
</a>
{{/next_post}}
{{#prev_post filter="tags:-[music,quotes]"}}
<a href="{{url}}" class="navigation-prev">
<div class="navigation-content ">
<small>{{t "Older post"}}</small>
<br>
<h3>{{title}}</h3>
</div>
{{#if feature_image}}
<div class="navigation-image global-image global-radius">
{{>images/other_image other_image=feature_image alt=""}}
</div>
{{/if}}
</a>
{{/prev_post}}
</div>
</aside>
{{else}}
<aside class="navigation-section global-padding">
<div class="navigation-wrap">
{{#next_post in="primary_tag"}}
<a href="{{url}}" class="navigation-next">
{{#if feature_image}}
<div class="navigation-image global-image global-radius">
{{>images/other_image other_image=feature_image alt=""}}
</div>
{{/if}}
<div class="navigation-content">
<small>{{t "Newer post"}}</small>
<br>
<h3>{{title}}</h3>
</div>
</a>
{{/next_post}}
{{#prev_post in="primary_tag"}}
<a href="{{url}}" class="navigation-prev">
<div class="navigation-content ">
<small>{{t "Older post"}}</small>
<br>
<h3>{{title}}</h3>
</div>
{{#if feature_image}}
<div class="navigation-image global-image global-radius">
{{>images/other_image other_image=feature_image alt=""}}
</div>
{{/if}}
</a>
{{/prev_post}}
</div>
</aside>
{{/has}}
It’s Basho, I have no more support from them and I like to found my own ways.
Playing on open-source is how I like to learn. I’m not doing this for other people or in a professional way.
I have my blog almost done and I’m not monetizing it but value is over the money for me.
Thanks, again!
1 Like
So one thing to look at - any #get request you’re making is going to completely ignore routing. It’s possible that is the source of your problem.
1 Like