Unable to create collections, routes upload fails. Please help :)

Hello,

I am simply trying to separate blog posts on my site into collections but having issues that I just don’t seem to be able to solve.

This is my current routes file:

routes:
  /:
    data: page.home
    template: home

collections:

  /wedding-blog/:
    permalink: /wedding-blog/{slug}/
    template: tag

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

Based on what I have read, it should look more like this?:

routes:
  /:
    data: page.home
    template: home

collections:

  /wedding-blog/:
    permalink: /wedding-blog/{slug}/
    template: tag
    filter: 'tag:-Wedding Venues'

  /wedding-venues/:
    permalink: /wedding-venues/{slug}/
    template: tag
    filter: 'tag:Wedding Venues'

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

But, this routes file won’t upload?

Template is based on the tag page as I just like the themes design. Have tried it with ‘index’ but same issue, won’t upload.

My aim is to have all posts displayed at /wedding-blog/, except any posts tagged ‘wedding-venues’, which I would like to live at /wedding-venues/.

Could you please help? My website is imagyarweddings.com in case someone kind enough tried to debug.

Many thanks,

Istvan

Hey @istvan,

When creating filters for your collections you need to use the slug version of your tags. You can find this in the tag menu in Ghost Admin. For the tag where the name is “Wedding Venues” the slug version will be something like wedding-venues - all in lower case and without spaces.

2 Likes

Hi Hannah,

Ah, I should have spotted that.

It is working now! Many thanks for helping me out!

Quick question, if my custom home page is just a static page does it make any difference if my code is:

routes:
  /:
    data: page.home
    template: home

or just

routes:
  /: home

Currently, my home.hbs file is a copy/duplicate of the post.hbs.

Many thanks

Istvan

1 Like