Feature/docs (#67)
This commit is contained in:
committed by
GitHub
parent
7a1ec55a5c
commit
81ca566b5e
@ -40,7 +40,7 @@ For GitHub and GitLab repositories, you can start your Static CMS `config.yml` f
|
||||
|
||||
```yaml
|
||||
backend:
|
||||
title: git-gateway
|
||||
name: git-gateway
|
||||
branch: main # Branch to update (optional; defaults to main)
|
||||
```
|
||||
|
||||
@ -92,18 +92,18 @@ Given this example, our `collections` settings would look like this in your Stat
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
- title: 'blog' # Used in routes, e.g., /admin/collections/blog
|
||||
- name: 'blog' # Used in routes, e.g., /admin/collections/blog
|
||||
label: 'Blog' # Used in the UI
|
||||
folder: '_posts/blog' # The path to the folder where the documents are stored
|
||||
create: true # Allow users to create new documents in this collection
|
||||
slug: '{{year}}-{{month}}-{{day}}-{{slug}}' # Filename template, e.g., YYYY-MM-DD-title.md
|
||||
fields: # The fields for each document, usually in front matter
|
||||
- { label: 'Layout', title: 'layout', widget: 'hidden', default: 'blog' }
|
||||
- { label: 'Title', title: 'title', widget: 'string' }
|
||||
- { label: 'Publish Date', title: 'date', widget: 'datetime' }
|
||||
- { label: 'Featured Image', title: 'thumbnail', widget: 'image' }
|
||||
- { label: 'Rating (scale of 1-5)', title: 'rating', widget: 'number' }
|
||||
- { label: 'Body', title: 'body', widget: 'markdown' }
|
||||
- { label: 'Layout', name: 'layout', widget: 'hidden', default: 'blog' }
|
||||
- { label: 'Title', name: 'title', widget: 'string' }
|
||||
- { label: 'Publish Date', name: 'date', widget: 'datetime' }
|
||||
- { label: 'Featured Image', name: 'thumbnail', widget: 'image' }
|
||||
- { label: 'Rating (scale of 1-5)', name: 'rating', widget: 'number' }
|
||||
- { label: 'Body', name: 'body', widget: 'markdown' }
|
||||
```
|
||||
|
||||
Let's break that down:
|
||||
@ -119,7 +119,7 @@ Let's break that down:
|
||||
|
||||
As described above, the `widget` property specifies a built-in or custom UI widget for a given field. When a content editor enters a value into a widget, that value is saved in the document front matter as the value for the `name` specified for that field. A full listing of available widgets can be found in the [Widgets doc](/docs/widgets).
|
||||
|
||||
Based on this example, you can go through the post types in your site and add the appropriate settings to your Static CMS `config.yml` file. Each post type should be listed as a separate node under the `collections` field. See the [Collections reference doc](/docs/configuration-options/#collections) for more configuration options.
|
||||
Based on this example, you can go through the post types in your site and add the appropriate settings to your Static CMS `config.yml` file. Each post type should be listed as a separate node under the `collections` field. See the [Collections reference doc](/docs/collection-overview) for more configuration options.
|
||||
|
||||
### Filter
|
||||
|
||||
@ -127,14 +127,14 @@ The entries for any collection can be filtered based on the value of a single fi
|
||||
|
||||
```yaml
|
||||
collections:
|
||||
- title: 'posts'
|
||||
- name: 'posts'
|
||||
label: 'Post'
|
||||
folder: '_posts'
|
||||
filter:
|
||||
field: language
|
||||
value: en
|
||||
fields:
|
||||
- { label: 'Language', title: 'language' }
|
||||
- { label: 'Language', name: 'language' }
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
Reference in New Issue
Block a user