add navigation to cms config

Tom Rutgers committed Aug 17, 2018
commit b2844ab27654218f3120a8bf2f28f28aa42e56c4
Showing 5 changed files with 20 additions and 9 deletions
data/shared/settings.yml +6 -0
@@ @@ -0,0 +1,6 @@
+ navigation:
+ - {label: 'Home', path: '#'}
+ - {label: 'Story', path: '#'}
+ - {label: 'Products', path: '#'}
+ - {label: 'News', path: '#'}
+ - {label: 'Contact', path: '#'}
\ No newline at end of file
data/shared/site.yml +0 -6
@@ @@ -1,6 +0,0 @@
- navigation:
- - {label: 'Home', path: '/'}
- - {label: 'Story', path: '/story/'}
- - {label: 'Products', path: '/products/'}
- - {label: 'News', path: '/news/'}
- - {label: 'Contact', path: '/contact/'}
\ No newline at end of file
source/admin/config.yml +12 -1
@@ @@ -43,4 +43,15 @@ collections:
widget: object
fields:
- {label: Title, name: title, widget: string}
- - {label: Image, name: image, widget: image}
\ No newline at end of file
+ - {label: Image, name: image, widget: image}
+
+ - name: settings
+ label: Settings
+ files:
+ - file: data/shared/settings.yml
+ label: Navigation
+ name: navigation
+ fields:
+ - {label: Label, name: label, widget: string}
+ - {label: Path, name: path, widget: string}
+
source/layouts/layout.slim +1 -1
@@ @@ -16,5 +16,5 @@ html
body
= partial 'partials/shared/header-primary'
- .main-content
+ main.main-content
= yield
source/partials/shared/_header-primary.slim +1 -1
@@ @@ -5,6 +5,6 @@ header.header-primary
nav.navigation
ul
- - data.shared.site.navigation.each do | nav_item |
+ - data.shared.settings.navigation.each do | nav_item |
li
= link_to nav_item.label, nav_item.path
\ No newline at end of file