Add products index page Make products scss reusable for other pages
Tom Rutgers
committed Aug 18, 2018
commit 9d0653dbd7b33ba42c97b71651e5f159b8b2e97f
Showing 7
changed files with
69 additions
and 27 deletions
data/products/caffea-congensis.yml
+12
-0
| @@ | @@ -0,0 +1,12 @@ |
| + | title: Caffea Congensis |
| + | date: 2018-08-12T13:00:49.366Z |
| + | image: /images/uploads/product-01.jpg |
| + | weight: |
| + | amount: '0.5' |
| + | price: |
| + | amount: '12' |
| + | currency: € |
| + | 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. |
| + | |
| + | This species, which grows along river courses in central and west central Africa, has an estimated extent of occurrence (EOO) of 645,500 km2 which exceeds the values needed for a threatened category under criterion B. Although it has specific habitat requirements, which may mean that the area of occupancy (AOO) is more restricted, it occurs at many more than ten locations and it suspected not be subject to severe fragmentation, extreme fluctuations or major threats and continuing decline. The population is suspected to be large and relatively stable. |
data/settings/navigation.yml
+1
-1
| @@ | @@ -1,6 +1,6 @@ |
| nav_items: | |
| - {label: 'Home', path: '/'} | |
| - {label: 'Story', path: '#'} | |
| - | - {label: 'Products', path: '#'} |
| + | - {label: 'Products', path: '/products/'} |
| - {label: 'News', path: '#'} | |
| - {label: 'Contact', path: '#'} | |
| \ No newline at end of file | |
source/partials/homepage/_products.slim
+1
-1
| @@ | @@ -1,4 +1,4 @@ |
| - | section.homepage-products |
| + | section.homepage-products.products |
| .container | |
| h2 | |
| | Products | |
source/products.html.slim
+30
-0
| @@ | @@ -0,0 +1,30 @@ |
| + | section.products |
| + | .container |
| + | h2 |
| + | | Products |
| + | .row |
| + | //product is structured: ['filename', 'data'] |
| + | //sort by newest product |
| + | - data.products.sort {|a,b| b[1].date <=> a[1].date}.each do | product | |
| + | |
| + | //to get the actual data: |
| + | - product = product[1] |
| + | |
| + | //link to product by converting the title to a slug |
| + | .product |
| + | = link_to '/products/' + product.title.parameterize |
| + | .product-image |
| + | = image_tag product.image |
| + | .product-content |
| + | .title |
| + | h3 = product.title |
| + | .price |
| + | p |
| + | = product.price.currency || '€' |
| + | | |
| + | = product.price.amount |
| + | .weight |
| + | p |
| + | = product.weight.amount |
| + | | |
| + | = product.weight.unit || 'kg' |
source/stylesheets/all.css.scss
+1
-1
| @@ | @@ -12,10 +12,10 @@ |
| @import 'demo/shared/header-primary'; | |
| @import 'demo/shared/main-content'; | |
| + | @import 'demo/products/products'; |
| @import 'demo/products/product'; | |
| @import 'demo/homepage/hero'; | |
| @import 'demo/homepage/story'; | |
| - | @import 'demo/homepage/products'; |
| @import 'demo/homepage/news'; | |
source/stylesheets/demo/homepage/_products.scss
+0
-24
| @@ | @@ -1,24 +0,0 @@ |
| - | .homepage-products { |
| - | padding-top: 60px; |
| - | padding-bottom: 60px; |
| - | background-color: $background-color-light; |
| - | |
| - | h2 { |
| - | margin: 0 0 30px; |
| - | } |
| - | |
| - | .product { |
| - | @extend %column; |
| - | @extend %col-sm-4; |
| - | @extend %product; |
| - | } |
| - | |
| - | @media screen and (max-width: $screen-xs-max) { |
| - | padding-top: 15px; |
| - | padding-bottom: 15px; |
| - | |
| - | h2 { |
| - | margin: 0 0 15px; |
| - | } |
| - | } |
| - | } |
| \ No newline at end of file | |
source/stylesheets/demo/products/_products.scss
+24
-0
| @@ | @@ -0,0 +1,24 @@ |
| + | .products { |
| + | padding-top: 60px; |
| + | padding-bottom: 60px; |
| + | background-color: $background-color-light; |
| + | |
| + | h2 { |
| + | margin: 0 0 30px; |
| + | } |
| + | |
| + | .product { |
| + | @extend %column; |
| + | @extend %col-sm-4; |
| + | @extend %product; |
| + | } |
| + | |
| + | @media screen and (max-width: $screen-xs-max) { |
| + | padding-top: 15px; |
| + | padding-bottom: 15px; |
| + | |
| + | h2 { |
| + | margin: 0 0 15px; |
| + | } |
| + | } |
| + | } |
| \ No newline at end of file | |