Skip to content

Instantly share code, notes, and snippets.

@Ferdi
Last active March 10, 2021 02:52
Show Gist options
  • Save Ferdi/e8f27c5368e3ab3089ec78c9f32ec576 to your computer and use it in GitHub Desktop.
Save Ferdi/e8f27c5368e3ab3089ec78c9f32ec576 to your computer and use it in GitHub Desktop.
# OCW-studio configuration file
# Instructs ocw-studio to :
# 1. Build content authoring UI for this particular site/coures type
# 2. Export content in a way that is undrstood by your static site generator (e.g. hugo)
#
# ocw-studio config follow very closely netlifycms config. We'll note when it diverges
#
collections: # A list of content types that content authors can author
- name: 'page'
label: 'Pages'
lable_singular: 'Page'. # used in UI i.e. "New Page"
tag: "Content" # where the links appear in ocw-studio side nav
description: >
Use pages to populate the main sections of your ocw course/site, like syllabus, lecture notes, presentations etc.
folder: 'not_sure' # where do pages end up in our content folder
slug: '{{title}}'
create: true # Allow content authors to create new documents in this collection
fields:
- {label: 'Title', name: 'title', widget: 'string'}
- {
label: 'Body',
name: 'body',
widget: 'markdown' # full wysiwyg toolbar
}
- {
label: 'Summary / SEO',
name: 'summary',
widget: 'text', # multiline text
hint: 'Short summary to help search engines find understand your content'
}
# @todo specify filtering options
- label: 'Resource'
name: 'resource'
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Select file", name: "mainfile", widget: "file"}
- {
label: 'File type',
name: 'mainfile-type',
widget: 'select', # maybe this should be 'hidden' instead
options:
- 'pdf'
- 'image'
- 'video'
- 'other'
}
# show the field below only if the type of resource is "image"
- {
label: "Text alternative",
name: "image-alt",
widget: "string",
# see https://github.com/netlify/netlify-cms/issues/565#issuecomment-506787922
condition: {type: fieldValue, field: mainfile-type, equals: image}
}
# @todo add other dependent fields for image and other types of contents (video ?)
- {
label: "Description",
name: "description",
widget: "markdown-light" #only a subset of markdown wysiwyg toolbar. Different from netlify
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment