How do I set Ghost Blog Custom Routes.yaml Collection Title / Meta Description in my custom template?

Using the Ghost blog routes.yaml file it is possible to use the collections block to create a custom collection made from some tag(s) and / or other data. You can also tell this collection to use a custom theme template see:


For instance:

    permalink: /example/{slug}/
    controller: channel
    filter: tag:example-tag
      - example

All of the above works and my collection properly uses my new example theme file.

The issue is that unlike the tag page (for example-tag) my new custom collection does not have a readily documented way to work with the title etc.

It does not pull the title / meta description from the tag used to build the collection (which would be great for collections built from single tags). In an attempt to work around that I tried some {{#has}} statements but I can't figure out what context the custom route would fit into.

With the above example routes.yaml the title for the custom collection ends up as 'My Site Name (Page 1)' — and there is no Meta Description.

This issue also extends into the Open Graph data which lists an identical title as well as no description for the custom collection.

My guess is that it may be possible to use a data property attached to the routes.yaml file to achieve this (see: but I haven't found a solution as of now.

While my initial attempts at googling for a solution came up empty, this is the best reference I have seen to the issue:



I found a way to work around.

  1. You create a page called example in the Ghost Admin tool.
  2. Customize routes (instead of collections) in the routes.yaml as following:
    controller: channel
    filter: tag:example-tag
    template: example
    data: page.example

The page.example will use the metadata of this page in the Ghost.

Posted on by xiaoke

Relevant tags