decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.65k stars 1 forks source link

Folder collection path based on fields #7192

Open snimavat opened 2 months ago

snimavat commented 2 months ago

We can specify path template for a folder collection - as described in docs here : Docs says, it supports template syntax similar to slug templates Slug templates allows use of fields

We would like to organise content based on value of certain fields (including relation type fields)

Example : City collection, with a relation field for state We would like to configure path for cities collection as path: '{{fields.state.name}}/{{slug}}' So that the content would be saved as shown below

- state1
   --- city1.md
   --- city2.md
- state2
   --- city3.md
   --- city4.md

But looks like, folder collection path template doesnt allow use of fields