I'm trying to change the Routes.yaml file

I’m trying to configure my site to have 2 collections as shown in the code below:

    routes:

    collections:
      /:
        permalink: /{slug}/
        template: index
      /anime/:
        permalink: /anime/{primary_tag}/{slug}/
        template: index
        filter: tag:hash-anime
        data: tag.anime
      /manga/:
        permalink: /manga/{primary_tag}/{slug}/
        template: index
        filter: tag:hash-manga
        data: tag.manga

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

I’ve already created all the tags that I think are necessary, follow the list below of created tags:

  • anime
  • manga
  • #manga
  • #anime

But it’s not working. Am I doing something wrong?

      /:
        permalink: /{slug}/
        template: index

You need to move this section to the end of the collections list. Since this collection doesn’t have a filter, all the posts get attached to it.

2 Likes

Wow! Thank you very much, I spent several hours trying to solve this problem.

I think it’s worth specifying this in this tutorial:
https://ghost.org/docs/api/v3/handlebars-themes/routing/collections/

I was following him until I came across this problem, I don’t know if this is something obvious but I don’t have as much knowledge to solve these problems, so I think it would be interesting to have this specified in the tutorial.

2 Likes