Routes updated - Posts still excluded

  • Ghost v4.18.0
  • Digital Ocean
  • Cloudflare

I’m trying to update my routes, but it doesn’t seem to be working properly.

My homepage uses the index template and I want it to display ALL posts. It previously had a filter applied to exclude posts, but I have removed it. I now use this:

collections:
/:
    permalink: /{year}/{month}/{day}/{slug}/
    template: index

The file loads correctly, but posts are still being ignored. The ignored posts are appearing in other collections, so I know they are working.

FYI, there is nothing complicated in my Capser theme index file. It’s literally as basic as it comes.

<div class="post-feed">
    {{#foreach posts}}
        {{> "post-card"}}
    {{/foreach}}
</div>

Any ideas?

Still not having any luck with this, but I have realised it must be due to some sort of ordering conflict with my routes file.

I have a bunch of collections. One in particular is not playing nice.

Example below: If I use this, all posts for hub load on the /hub/ page, but not the main index homepage.

collections:
  /hub/:
    permalink: /hub/{slug}/
    template: hub
    filter: primary_tag:hub
  /:
    permalink: /{year}/{month}/{day}/{slug}/
    template: index

If I swap them around. The hub tagged posts appear on the homepage, but not on the hub page.

collections:
  /:
    permalink: /{year}/{month}/{day}/{slug}/
    template: index
  /hub/:
    permalink: /hub/{slug}/
    template: hub
    filter: primary_tag:hub

Not sure what I’m missing here. My understanding is that all posts should be displayed at the homepage level because there are no filters applied. What am I missing here?

Posts will only exist in one collection, based on the first filter it matches with. As explained here:
Building content collections in Ghost.

Maybe it’s better to use channels: