Fix errors in site settings

Tom Rutgers committed Aug 20, 2018
commit a37aa3a03d24550fb4cb7fbeaf14009eaae7abe4
Showing 7 changed files with 15 additions and 15 deletions
data/products/coffee-arabica.yml +1 -1
@@ @@ -2,7 +2,7 @@ title: Coffea Arabica
date: 2018-08-17T22:42:07.084Z
image: /images/uploads/product-01.png
weight: '0.5'
- price:'14'
+ price: '14'
body: >-
Coffea arabica, also known as the Arabian coffee, "coffee shrub of Arabia",
"mountain coffee", or "arabica coffee", is a species of Coffea. It is believed
data/settings/navigation.yml +5 -0
@@ @@ -0,0 +1,5 @@
+ nav_items:
+ - {label: 'Home', path: '/'}
+ - {label: 'Products', path: '/products/'}
+ - {label: 'News', path: '/news'}
+
data/settings/site.yml +0 -5
@@ @@ -1,5 +0,0 @@
- navigation:
- - {label: 'Home', path: '/'}
- - {label: 'Products', path: '/products/'}
- - {label: 'News', path: '/news'}
-
data/settings/units.yml +2 -0
@@ @@ -0,0 +1,2 @@
+ currency: '€'
+ weight: 'kg'
\ No newline at end of file
source/partials/products/_product.slim +4 -6
@@ @@ -8,11 +8,9 @@
h3 = product.title
.price
p
- = product.price.currency || '€'
- |
- = product.price.amount
+ - currency = data.settings.units.currency || '€'
+ = currency + product.price
.weight
p
- = product.weight.amount
- |
- = product.weight.unit || 'kg'
+ - weight = data.settings.units.weight || 'kg'
+ = product.weight + weight
\ No newline at end of file
source/partials/shared/_header-primary.slim +1 -1
@@ @@ -9,7 +9,7 @@ header.header-primary
nav.navigation
ul
- - data.settings.site.navigation.each do | nav_item |
+ - data.settings.navigation.nav_items.each do | nav_item |
li
= nav_link nav_item.label, nav_item.path
source/product.html.slim +2 -2
@@ @@ -6,11 +6,11 @@
.weight
- weight = data.settings.units.weight || 'kg'
- span = product.weight.amount + weight
+ span = product.weight + weight
.price
- currency = data.settings.units.currency || '€'
- span = currency + product.price.amount
+ span = currency + product.price
.body
= markdown product.body
\ No newline at end of file