Use Hugo page bundles.
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Boolean"
|
||||
target: "boolean"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Boolean
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Date"
|
||||
target: "date"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Date
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "DateTime"
|
||||
target: "datetime"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### DateTime
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "File"
|
||||
target: "file"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### File
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Hidden"
|
||||
target: "hidden"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Hidden
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Image"
|
||||
target: "image"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Image
|
||||
|
30
website/site/content/docs/widgets/index.md
Normal file
30
website/site/content/docs/widgets/index.md
Normal file
@ -0,0 +1,30 @@
|
||||
---
|
||||
title: Widgets
|
||||
position: 30
|
||||
---
|
||||
|
||||
# Widgets
|
||||
|
||||
Widgets define the data type and interface for entry fields. Netlify CMS comes with several built-in widgets. Click the widget names in the sidebar to jump to specific widget details. We’re always adding new widgets, and you can also [create your own](https://www.netlifycms.org/docs/custom-widgets)!
|
||||
|
||||
Widgets are specified as collection fields in the `config.yml` file. Note that [YAML syntax](https://en.wikipedia.org/wiki/YAML#Basic_components) allows lists and objects to be written in block or inline style, and the code samples below include a mix of both.
|
||||
|
||||
To see working examples of all of the built-in widgets, try making a 'Kitchen Sink' collection item on the [CMS demo site](https://cms-demo.netlify.com). (No login required: click the login button and the CMS will open.) You can refer to the demo [configuration code](https://github.com/netlify/netlify-cms/blob/master/example/config.yml#L60) to see how each field was configured.
|
||||
|
||||
|
||||
## Common widget options
|
||||
|
||||
The following options are available on all fields:
|
||||
|
||||
- `required`: specify as `false` to make a field optional; defaults to `true`
|
||||
- `pattern`: add field validation by specifying a list with a [regex pattern](https://regexr.com/) and an error message; more extensive validation can be achieved with [custom widgets](https://www.netlifycms.org/docs/custom-widgets/#advanced-field-validation)
|
||||
- **Example:**
|
||||
|
||||
```yaml
|
||||
- label: "Title"
|
||||
name: "title"
|
||||
widget: "string"
|
||||
pattern: ['.{12,}', "Must have at least 12 characters"]
|
||||
```
|
||||
|
||||
## Default widgets
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "List"
|
||||
target: "list"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### List
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Markdown"
|
||||
target: "markdown"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Markdown
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Number"
|
||||
target: "number"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Number
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Object"
|
||||
target: "object"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Object
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Relation"
|
||||
target: "relation"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Relation
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Select"
|
||||
target: "select"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Select
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "String"
|
||||
target: "string"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### String
|
||||
|
@ -1,7 +1,6 @@
|
||||
---
|
||||
label: "Text"
|
||||
target: "text"
|
||||
type: "widget"
|
||||
---
|
||||
|
||||
### Text
|
||||
|
Reference in New Issue
Block a user