Reputation: 1728
I have a Hugo-based site and a couple of partials
on the main page that I would like to add as parts of CMS. The partials are made of HTML layout and YAML in the data section. How can I expose this information to CMS?
Upvotes: 0
Views: 226
Reputation: 589
Your question is a little vague, but assuming that your partials are driven by that YAML data, you can look at the file collection type to manage it.
Here's an example of what your config.yml
file might look like:
collections:
- label: "Settings"
name: "settings"
files:
- label: "Partials"
name: "partials"
file: "data/partials.yml"
fields:
- label: "List of partials"
name: "partials_list"
widget: "list"
fields:
- {label: "Name", name: "name", widget: "string"}
- {label: "Partial type", name: "type", widget: "select", options: ["typeA", "typeB", "typeC"] }
Upvotes: 0