Can you dynamically create collections based on primary_tag?



Using Ghost 2.

Trying to work out how to dynamically create catalogs based on primary tags.

That is, rather than having to manually specify every catalog in routes.yaml, eg:

    permalink: /catalog1/{slug}/
    filter: primary_tag:catalog1
    permalink: /catalog2/{slug}/
    filter: primary_tag:catalog2
    permalink: /catalog3/{slug}/
    filter: primary_tag:catalog3
. etc

Obviously this doesn’t work, but is it possible to do something like this:

    permalink: /{{primary_tag}}/{slug}/
    filter: primary_tag:{{primary_tag}}

That way, as content creators generate and use new primary tags, these collections are automatically defined and made available; and no maintenance of routes.yaml necessary.

Just can’t get my head around it. All hints welcome!!!

closed #2

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.