0

Hugo CMS project

My Hugo CMS content folder organized like this:

/content/worldnews/

/content/nationalnews/

/content/statenews/

Now, I need a decap cms collctions config which have an option for folder dropdown to choose the news type. Like world, national, state.

If I select "world" the post must saved to /content/worldnews/

If I select "national" the post must saved to /content/nationalnews/

If I select "state" the post must saved to /content/statenews/

I tried this but not successful as it saves it to root folder "content"

  - name: blog
    label: Blog Posts
    folder: { fields.folder }
    create: true
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Content", name: "content", widget: "markdown" }
      - { label: "Date", name: "date", widget: "datetime" }
      - { label: "Folder", name: "folder", widget: "select", options: ["world", "national", "state"] }
1
  • Either create three different decap-cms collections, or have all post be in one collection and instruct your static site generator to output the files to different folder depending on said field.
    – mb21
    Commented Apr 26 at 18:11

0

Browse other questions tagged or ask your own question.