Add currency and weight units to site settings

Tom Rutgers committed Aug 20, 2018
commit a3114b64d0253f4af27ae480ab5a498ee061c09c
Showing 7 changed files with 35 additions and 44 deletions
data/products/caffea-congensis.yml +2 -5
@@ @@ -1,11 +1,8 @@
title: Coffea Congensis
date: 2018-08-12T13:00:49.366Z
image: /images/uploads/product-01.png
- weight:
- amount: '0.5'
- price:
- amount: '12'
- currency: €
+ weight: '0.5'
+ price: '12'
body: >-
Coffea congensis is similar in appearance to C. canephora with which it is closely related. It is a variable species and within each natural population there is a considerable amount of morphological variation. It is a wild relative of commercial coffee species, C. arabica L. and C. canephora Pierre ex A.Froehner , and is classified in Gene Pool 2 and 1 respectively, following the definition of Maxted.
data/products/caffea-liberica.yml +2 -5
@@ @@ -1,11 +1,8 @@
title: Coffea Liberica
date: 2018-08-17T22:10:49.366Z
image: /images/uploads/product-01.png
- weight:
- amount: '0.5'
- price:
- amount: '18'
- currency: €
+ weight: '0.5'
+ price: '18'
body: >-
The Coffea liberica tree grows up to 20 metres in height, producing larger
fruits than those found on Coffea arabica trees. This coffee was brought to
data/products/coffea-robusta.yml +2 -5
@@ @@ -1,11 +1,8 @@
title: Coffea Robusta
date: 2018-08-17T22:54:12.263Z
image: /images/uploads/product-01.png
- weight:
- amount: '0.5'
- unit: kg
- price:
- amount: '12'
+ weight: '0.5'
+ price: '12'
body: >-
Coffea canephora, commonly known as robusta coffee, is a species of coffee
that has its origins in central and western sub-Saharan Africa. It is a
data/products/coffee-arabica.yml +2 -6
@@ @@ -1,12 +1,8 @@
title: Coffea Arabica
date: 2018-08-17T22:42:07.084Z
image: /images/uploads/product-01.png
- weight:
- amount: '0.5'
- unit: kg
- price:
- amount: '14'
- currency: €
+ weight: '0.5'
+ 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 +0 -4
@@ @@ -1,4 +0,0 @@
- nav_items:
- - {label: 'Home', path: '/'}
- - {label: 'Products', path: '/products/'}
- - {label: 'News', path: '/news'}
\ No newline at end of file
data/settings/site.yml +5 -0
@@ @@ -0,0 +1,5 @@
+ navigation:
+ - {label: 'Home', path: '/'}
+ - {label: 'Products', path: '/products/'}
+ - {label: 'News', path: '/news'}
+
source/admin/config.yml +22 -19
@@ @@ -21,20 +21,8 @@ collections:
- {label: Publish Date, name: date, widget: datetime}
- {label: Image, name: image, widget: image, required: true}
- - label: Weight
- name: weight
- widget: object
- fields:
- - {label: Amount, name: amount, widget: number}
- - {label: Unit, name: unit, widget: select, options: ['kg', 'pound', 'stone'], default: 'kg'}
-
- - label: Price
- name: price
- widget: object
- fields:
- - {label: Amount, name: amount, widget: number}
- - {label: Currency, name: currency, widget: select, options: ['€', '$', '£'], default: '€'}
-
+ - {label: Weight, name: weight, widget: number}
+ - {label: Price, name: price, widget: number}
- {label: Body, name: body, widget: markdown}
#markdown middleman blog example
@@ @@ -72,14 +60,29 @@ collections:
- name: settings
label: Settings
files:
- - file: data/settings/navigation.yml
- label: Navigation
- name: navigation
+ - file: data/settings/site.yml
+ label: Site settings
+ name: site_settings
fields:
- - label: Navigation items
- name: nav_items
+ - label: Navigation
+ name: navigation
widget: list
fields:
- {label: Label, name: label, widget: string}
- {label: Path, name: path, widget: string}
+ - label: Units
+ name: units
+ widget: object
+ fields:
+ - label: Currency
+ name: currency
+ widget: select
+ options: ['€', '$', '£']
+ default: '€'
+
+ - label: Weight
+ name: weight
+ widget: select
+ options: ['kg', ' st', ' lb']
+ default: 'kg'