Hi
Repo is here https://github.com/mshiner/bkvelo - I have Front matter defined as follows in my archetype for a Ride
+++
title = “{{ replace .Name “-” " " | title }}”
date = {{ .Date }}
draft = false
categories = “Group Ride”
rideDate = {{ .Date }}
expiryDate = {{ .Date }}
startFrom = “Brent Knoll Village Hall”
duration = “4h”
+++
I added Netlify CMS - here is the section from the CMS config.yml
collections:
- name: “rides” # Used in routes, e.g., /admin/collections/blog
label: “Rides” # Used in the UI
label_singular: “Ride” # Used in the UI, ie: “New Ride”
description: >
Rides - share what you are doing.
folder: “content/rides” # The path to the folder where the documents are stored
create: true # Allow users to create new documents in this collection
slug: “{{slug}}” # Filename template, e.g., YYYY-MM-DD-title.md
fields: # The fields for each document, usually in front matter
- {label: “Title”, name: “title”, widget: “string”}
- {label: “Creation Date”, name: “date”, widget: “datetime”}
- {label: “Draft”, name: “draft”, widget: “boolean”, default: false}
- {label: “Categories”, name: “categories”, widget: “select”, options: [“Audax”, “Casuual/Family Ride”, “Cyclocross”, “Fixed”, “Group Ride”, “Sportive”]}
- {label: “Ride Date”, name: “rideDate”, widget: “datetime”}
- {label: “Expires”, name: “expiryDate”, widget: “datetime”}
- {label: “Start From”, name: “startFrom”, widget: “string”}
- {label: “Duration”, name: “duration”, widget: “string”}
- {label: “Body”, name: “body”, widget: “markdown”}
When I save a ride through CMS Netlify saves the front matter as YAML like so…
title: Test Ride day 1
date: ‘2018-03-18T15:13:28+00:00’
draft: false
categories: Group Ride
rideDate: ‘2018-03-21T15:00:28+00:00’
expiryDate: ‘2018-03-31T00:00:00+01:00’
startFrom: Oudenaarde Belgium
duration: 2 HoursTesting out the bikes before the 3 days of cobbles.
Consequently my build fails with errors because the dates are strings and I do some .Unix stuff to determine if a ride is in the future.
Any ideas how I can correct for this?
Thanks M