Hi, I would like to automatically add a nav item whenever a page is published. Right now, I have a page and config collection. In order to show a page in the navigation, I need to first create the page, and then go to config to create a navigation item with the same title and link. Is there a way, perhaps in the config.yml, to streamline this process?
collections:
- name: 'page'
label: 'Page'
folder: '_pages/'
create: true
slug: '{{slug}}'
editor:
preview: false
fields:
- {label: "Layout", name: "layout", widget: "hidden", default: "page"}
- {label: "Title", name: "title", widget: "string"}
- {label: "Permalink", name: "permalink", widget: "string"}
- {label: 'Body', name: 'body', widget: 'markdown'}
- name: "config"
label: "Config"
editor:
preview: false
files:
- label: "Navigation"
name: "navigation"
file: "_data/navigation.yml"
fields:
- label: "Navigation Items"
name: "links"
widget: "list"
fields:
- {label: Title, name: title, widget: string}
- {label: Link, name: url, widget: string}