update navigation data structure

Tom Rutgers committed Aug 17, 2018
commit 9b4526f7a226ae38398403f3cebca95412a625a7
Showing 4 changed files with 14 additions and 10 deletions
data/settings/navigation.yml +6 -0
@@ @@ -0,0 +1,6 @@
+ nav_items:
+ - {label: 'Home', path: '#'}
+ - {label: 'Story', path: '#'}
+ - {label: 'Products', path: '#'}
+ - {label: 'News', path: '#'}
+ - {label: 'Contact', path: '#'}
\ No newline at end of file
data/shared/settings.yml +0 -6
@@ @@ -1,6 +0,0 @@
- navigation:
- - {label: 'Home', path: '#'}
- - {label: 'Story', path: '#'}
- - {label: 'Products', path: '#'}
- - {label: 'News', path: '#'}
- - {label: 'Contact', path: '#'}
\ No newline at end of file
source/admin/config.yml +7 -3
@@ @@ -48,10 +48,14 @@ collections:
- name: settings
label: Settings
files:
- - file: data/shared/settings.yml
+ - file: data/settings/navigation.yml
label: Navigation
name: navigation
fields:
- - {label: Label, name: label, widget: string}
- - {label: Path, name: path, widget: string}
+ - label: Navigation item
+ name: nav_item
+ widget: list
+ fields:
+ - {label: Label, name: label, widget: string}
+ - {label: Path, name: path, widget: string}
source/partials/shared/_header-primary.slim +1 -1
@@ @@ -5,6 +5,6 @@ header.header-primary
nav.navigation
ul
- - data.shared.settings.navigation.each do | nav_item |
+ - data.settings.navigation.nav_items.each do | nav_item |
li
= link_to nav_item.label, nav_item.path
\ No newline at end of file