Skip to content

Instantly share code, notes, and snippets.

@ashx3s
Last active November 15, 2021 22:41
Show Gist options
  • Select an option

  • Save ashx3s/f16358b2eeffb684b89991dd877fe3ef to your computer and use it in GitHub Desktop.

Select an option

Save ashx3s/f16358b2eeffb684b89991dd877fe3ef to your computer and use it in GitHub Desktop.
Netlify CMS Widgit

Netlify CMS Widgit Configuration

Backend

  • Set this to:
backend:
  name: git-gateway
  branch: main
  • This is telling netlify how to access the content and from which branch.
  • The branch setting is especially great for when you are using feature branches for development

media folder

specify where uploaded content goes. this defaults to static/img. Make sure your directory structure is the same

Collections

  • This doc page has a list of the different collection figurations that you can use.
  • A name is required, this should be lowercase
  • A label is what the editor will see, capitalize this
  • A folder field is where you specify for your articles to go
  • frontmatter defaults to .yml, however you can use toml or json if you prefer
  • slug is used to note the naming system for your entries. the slug field is a url safe version of the title specified of the article

Widgets and Fields

  • Check out the widget options here
  • Use the fields to create the input boxes for your content editor
fields:
  - { label: 'Title', name: 'title', widget: 'string'}
  - { label: 'Publish Date', name: 'date', widget: 'datetime' }
  - { label: 'Body', name: 'body', widget: 'markdown' }

  • This example will give 3 fields for the content editor to work in
  • Add a title using a string widget
  • Add a Published date using a datetime widget
  • Add a blog entry using the markdown editor widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment