Using collections but keeping an index with all the posts

Try this:

routes:
  /:
    controller: channel
    template: index

collections:
  /musique/:
    permalink: /musique/{slug}/
    template: custom-collections
    filter: primary_tag:musique
  /photo/:
    permalink: /photo/{slug}/
    template: custom-collections
    filter: primary_tag:photo
  /moto/:
    permalink: /moto/{slug}/
    template: custom-collections
    filter: primary_tag:moto
  /carnets-de-voyage/:
    permalink: /carnets-de-voyage/{slug}/
    template: custom-collections
    filter: primary_tag:carnets-de-voyage
  /les-petites-videos/:
    permalink: /les-petites-videos/{slug}/
    template: custom-collections
    filter: primary_tag:les-petites-videos

# NOTE: if you plan on having posts without any of the above primary tags, you need to add a collection here to "catch" the posts that weren't caught by the other filters

taxonomies:
  tag: /{slug}/
  author: /auteur/{slug}/

I’m not 100% sure if you need to add a filter for the route

5 Likes