(docs) fixed 404s and minor typos (#1639)
**Summary** Fixed 404s (converted absolute links to relative links) and minor typos across several pages. **Test plan** Previewed locally **A picture of a cute animal (not mandatory but encouraged)** ![pups](https://user-images.githubusercontent.com/31967674/44364132-353b6480-a494-11e8-9b01-ff7d32bfceda.jpg)
This commit is contained in:
parent
ffe1e0698d
commit
0adfd4f04c
@ -1004,6 +1004,15 @@
|
|||||||
"contributions": [
|
"contributions": [
|
||||||
"doc"
|
"doc"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "cdschroeder",
|
||||||
|
"name": "Casey Schroeder",
|
||||||
|
"avatar_url": "https://avatars3.githubusercontent.com/u/31967674?v=4",
|
||||||
|
"profile": "https://github.com/cdschroeder",
|
||||||
|
"contributions": [
|
||||||
|
"doc"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"repoType": "github"
|
"repoType": "github"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Netlify CMS
|
# Netlify CMS
|
||||||
[![All Contributors](https://img.shields.io/badge/all_contributors-114-orange.svg)](#contributors)
|
[![All Contributors](https://img.shields.io/badge/all_contributors-115-orange.svg)](#contributors)
|
||||||
[![Open Source Helpers](https://www.codetriage.com/netlify/netlify-cms/badges/users.svg)](https://www.codetriage.com/netlify/netlify-cms)
|
[![Open Source Helpers](https://www.codetriage.com/netlify/netlify-cms/badges/users.svg)](https://www.codetriage.com/netlify/netlify-cms)
|
||||||
[![](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/netlify/netlifycms)
|
[![](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/netlify/netlifycms)
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ These wonderful folks are responsible for developing and maintaining Netlify CMS
|
|||||||
| [<img src="https://avatars3.githubusercontent.com/u/26639499?v=4" width="100px;"/><br /><sub><b>David Ko</b></sub>](https://github.com/daveyko)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=daveyko "Code") | [<img src="https://avatars3.githubusercontent.com/u/440562?v=4" width="100px;"/><br /><sub><b>Iñaki García</b></sub>](http://www.txorua.com)<br />[🎨](#design-igarbla "Design") | [<img src="https://avatars3.githubusercontent.com/u/27162255?v=4" width="100px;"/><br /><sub><b>Sam</b></sub>](https://github.com/gazebosx3)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=gazebosx3 "Code") | [<img src="https://avatars1.githubusercontent.com/u/174777?v=4" width="100px;"/><br /><sub><b>Josh Dzielak</b></sub>](https://dzello.com)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=dzello "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/2193?v=4" width="100px;"/><br /><sub><b>Jeremy Bise</b></sub>](http://thosegeeks.com)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=jeremybise "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/13282103?v=4" width="100px;"/><br /><sub><b>terrierscript</b></sub>](https://terrierscript.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=terrierscript "Code") | [<img src="https://avatars0.githubusercontent.com/u/3949335?v=4" width="100px;"/><br /><sub><b>Christopher Geary</b></sub>](https://twitter.com/crgeary)<br />[🔌](#plugin-crgeary "Plugin/utility libraries") |
|
| [<img src="https://avatars3.githubusercontent.com/u/26639499?v=4" width="100px;"/><br /><sub><b>David Ko</b></sub>](https://github.com/daveyko)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=daveyko "Code") | [<img src="https://avatars3.githubusercontent.com/u/440562?v=4" width="100px;"/><br /><sub><b>Iñaki García</b></sub>](http://www.txorua.com)<br />[🎨](#design-igarbla "Design") | [<img src="https://avatars3.githubusercontent.com/u/27162255?v=4" width="100px;"/><br /><sub><b>Sam</b></sub>](https://github.com/gazebosx3)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=gazebosx3 "Code") | [<img src="https://avatars1.githubusercontent.com/u/174777?v=4" width="100px;"/><br /><sub><b>Josh Dzielak</b></sub>](https://dzello.com)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=dzello "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/2193?v=4" width="100px;"/><br /><sub><b>Jeremy Bise</b></sub>](http://thosegeeks.com)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=jeremybise "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/13282103?v=4" width="100px;"/><br /><sub><b>terrierscript</b></sub>](https://terrierscript.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=terrierscript "Code") | [<img src="https://avatars0.githubusercontent.com/u/3949335?v=4" width="100px;"/><br /><sub><b>Christopher Geary</b></sub>](https://twitter.com/crgeary)<br />[🔌](#plugin-crgeary "Plugin/utility libraries") |
|
||||||
| [<img src="https://avatars0.githubusercontent.com/u/23248886?v=4" width="100px;"/><br /><sub><b>Brian Macdonald</b></sub>](https://github.com/brianlmacdonald)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=brianlmacdonald "Code") | [<img src="https://avatars1.githubusercontent.com/u/15092?v=4" width="100px;"/><br /><sub><b>John Vandenberg</b></sub>](https://jayvdb.github.io/)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=jayvdb "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/24911956?v=4" width="100px;"/><br /><sub><b>MarkZither</b></sub>](https://github.com/MarkZither)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=MarkZither "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/9257284?v=4" width="100px;"/><br /><sub><b>Rob Phoenix</b></sub>](https://www.robphoenix.com)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=robphoenix "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/3028764?v=4" width="100px;"/><br /><sub><b>Steve Lathrop</b></sub>](https://www.SteLa.io)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=slathrop "Code") [📖](https://github.com/netlify/netlify-cms/commits?author=slathrop "Documentation") [💡](#example-slathrop "Examples") | [<img src="https://avatars0.githubusercontent.com/u/10004167?v=4" width="100px;"/><br /><sub><b>Maciej Matuszewski</b></sub>](https://github.com/maciejmatu)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=maciejmatu "Code") | [<img src="https://avatars0.githubusercontent.com/u/36023898?v=4" width="100px;"/><br /><sub><b>Eko Eryanto</b></sub>](https://github.com/ekoeryanto)<br />[🔌](#plugin-ekoeryanto "Plugin/utility libraries") |
|
| [<img src="https://avatars0.githubusercontent.com/u/23248886?v=4" width="100px;"/><br /><sub><b>Brian Macdonald</b></sub>](https://github.com/brianlmacdonald)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=brianlmacdonald "Code") | [<img src="https://avatars1.githubusercontent.com/u/15092?v=4" width="100px;"/><br /><sub><b>John Vandenberg</b></sub>](https://jayvdb.github.io/)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=jayvdb "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/24911956?v=4" width="100px;"/><br /><sub><b>MarkZither</b></sub>](https://github.com/MarkZither)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=MarkZither "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/9257284?v=4" width="100px;"/><br /><sub><b>Rob Phoenix</b></sub>](https://www.robphoenix.com)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=robphoenix "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/3028764?v=4" width="100px;"/><br /><sub><b>Steve Lathrop</b></sub>](https://www.SteLa.io)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=slathrop "Code") [📖](https://github.com/netlify/netlify-cms/commits?author=slathrop "Documentation") [💡](#example-slathrop "Examples") | [<img src="https://avatars0.githubusercontent.com/u/10004167?v=4" width="100px;"/><br /><sub><b>Maciej Matuszewski</b></sub>](https://github.com/maciejmatu)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=maciejmatu "Code") | [<img src="https://avatars0.githubusercontent.com/u/36023898?v=4" width="100px;"/><br /><sub><b>Eko Eryanto</b></sub>](https://github.com/ekoeryanto)<br />[🔌](#plugin-ekoeryanto "Plugin/utility libraries") |
|
||||||
| [<img src="https://avatars3.githubusercontent.com/u/366688?v=4" width="100px;"/><br /><sub><b>Taylor D. Edmiston</b></sub>](http://blog.tedmiston.com/)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=tedmiston "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/1088089?v=4" width="100px;"/><br /><sub><b>Daniel Mahon</b></sub>](https://www.mahonstudios.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=danielmahon "Code") | [<img src="https://avatars1.githubusercontent.com/u/16711653?v=4" width="100px;"/><br /><sub><b>Evan Hennessy</b></sub>](https://www.hennessyevan.com)<br />[🔌](#plugin-hennessyevan "Plugin/utility libraries") | [<img src="https://avatars1.githubusercontent.com/u/3259517?v=4" width="100px;"/><br /><sub><b>Hasan Azizul Haque</b></sub>](https://hasanavi.me)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=hasanavi "Code") [📖](https://github.com/netlify/netlify-cms/commits?author=hasanavi "Documentation") [🤔](#ideas-hasanavi "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/5166612?v=4" width="100px;"/><br /><sub><b>Robert Karlsson</b></sub>](https://github.com/robertkarlsson)<br />[🐛](https://github.com/netlify/netlify-cms/issues?q=author%3Arobertkarlsson "Bug reports") | [<img src="https://avatars2.githubusercontent.com/u/3484527?v=4" width="100px;"/><br /><sub><b>Gil Greenberg</b></sub>](http://gilgreenberg.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=gil-- "Code") | [<img src="https://avatars0.githubusercontent.com/u/649890?v=4" width="100px;"/><br /><sub><b>Tyler Ipson</b></sub>](http://loremipson.com)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=loremipson "Documentation") |
|
| [<img src="https://avatars3.githubusercontent.com/u/366688?v=4" width="100px;"/><br /><sub><b>Taylor D. Edmiston</b></sub>](http://blog.tedmiston.com/)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=tedmiston "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/1088089?v=4" width="100px;"/><br /><sub><b>Daniel Mahon</b></sub>](https://www.mahonstudios.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=danielmahon "Code") | [<img src="https://avatars1.githubusercontent.com/u/16711653?v=4" width="100px;"/><br /><sub><b>Evan Hennessy</b></sub>](https://www.hennessyevan.com)<br />[🔌](#plugin-hennessyevan "Plugin/utility libraries") | [<img src="https://avatars1.githubusercontent.com/u/3259517?v=4" width="100px;"/><br /><sub><b>Hasan Azizul Haque</b></sub>](https://hasanavi.me)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=hasanavi "Code") [📖](https://github.com/netlify/netlify-cms/commits?author=hasanavi "Documentation") [🤔](#ideas-hasanavi "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/5166612?v=4" width="100px;"/><br /><sub><b>Robert Karlsson</b></sub>](https://github.com/robertkarlsson)<br />[🐛](https://github.com/netlify/netlify-cms/issues?q=author%3Arobertkarlsson "Bug reports") | [<img src="https://avatars2.githubusercontent.com/u/3484527?v=4" width="100px;"/><br /><sub><b>Gil Greenberg</b></sub>](http://gilgreenberg.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=gil-- "Code") | [<img src="https://avatars0.githubusercontent.com/u/649890?v=4" width="100px;"/><br /><sub><b>Tyler Ipson</b></sub>](http://loremipson.com)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=loremipson "Documentation") |
|
||||||
| [<img src="https://avatars0.githubusercontent.com/u/1061992?v=4" width="100px;"/><br /><sub><b>Jake Rayson</b></sub>](https://www.growdigital.org/)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=growdigital "Code") [📝](#blog-growdigital "Blogposts") [💡](#example-growdigital "Examples") | [<img src="https://avatars1.githubusercontent.com/u/42543284?v=4" width="100px;"/><br /><sub><b>Kurt collins</b></sub>](https://github.com/kurtgcollins)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=kurtgcollins "Documentation") |
|
| [<img src="https://avatars0.githubusercontent.com/u/1061992?v=4" width="100px;"/><br /><sub><b>Jake Rayson</b></sub>](https://www.growdigital.org/)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=growdigital "Code") [📝](#blog-growdigital "Blogposts") [💡](#example-growdigital "Examples") | [<img src="https://avatars1.githubusercontent.com/u/42543284?v=4" width="100px;"/><br /><sub><b>Kurt collins</b></sub>](https://github.com/kurtgcollins)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=kurtgcollins "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/31967674?v=4" width="100px;"/><br /><sub><b>Casey Schroeder</b></sub>](https://github.com/cdschroeder)<br />[📖](https://github.com/netlify/netlify-cms/commits?author=cdschroeder "Documentation") |
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||||
|
|
||||||
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
|
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
|
||||||
|
@ -10,7 +10,7 @@ The core abstractions for content editing are `collections`, `entries` and `widg
|
|||||||
|
|
||||||
Each `collection` represents a collection of entries. This can either be a collection of similar entries with the same structure, or a set of entries where each has its own structure.
|
Each `collection` represents a collection of entries. This can either be a collection of similar entries with the same structure, or a set of entries where each has its own structure.
|
||||||
|
|
||||||
The structure of an entry is defined as a series of fields, each with a `name`, a `label`, and a `widget` .
|
The structure of an entry is defined as a series of fields, each with a `name`, a `label`, and a `widget`.
|
||||||
|
|
||||||
The `widget` determines the UI widget that the content editor will use when editing this field of an entry, as well as how the content of the field is presented in the editing preview.
|
The `widget` determines the UI widget that the content editor will use when editing this field of an entry, as well as how the content of the field is presented in the editing preview.
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ Entries are loaded and persisted through a `backend` that will typically represe
|
|||||||
|
|
||||||
**Config:** Holds the environment configuration (backend type, available collections and fields).
|
**Config:** Holds the environment configuration (backend type, available collections and fields).
|
||||||
|
|
||||||
**Collections** List of available collections, their fields and metadata information.
|
**Collections:** List of available collections, their fields and metadata information.
|
||||||
|
|
||||||
**Entries:** Entries for each field.
|
**Entries:** Entries for each field.
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ Selectors are functions defined within reducers used to compute derived data fro
|
|||||||
**getAsset:** Selects a single AssetProxy object for the given URI.
|
**getAsset:** Selects a single AssetProxy object for the given URI.
|
||||||
|
|
||||||
## Value Objects
|
## Value Objects
|
||||||
**AssetProxy:** AssetProxy is a Value Object that holds information regarding an asset file (such as an image, for example), whether it's persisted online or held locally in cache.
|
**AssetProxy:** AssetProxy is a Value Object that holds information regarding an asset file (for example, an image), whether it's persisted online or held locally in cache.
|
||||||
|
|
||||||
For a file persisted online, the AssetProxy only keeps information about its URI. For local files, the AssetProxy will keep a reference to the actual File object while generating the expected final URIs and on-demand blobs for local preview.
|
For a file persisted online, the AssetProxy only keeps information about its URI. For local files, the AssetProxy will keep a reference to the actual File object while generating the expected final URIs and on-demand blobs for local preview.
|
||||||
|
|
||||||
@ -72,6 +72,6 @@ Furthermore, all editorial workflow state is managed in Redux - there's an `acti
|
|||||||
|
|
||||||
### About metadata
|
### About metadata
|
||||||
|
|
||||||
Netlify CMS embraces the idea of Git-as-backend for storing metadata. The first time it runs with the editorial_workflow setup, it creates a new ref called `meta/_netlify_cms`, pointing to an empty, orphan tree.
|
Netlify CMS embraces the idea of Git-as-backend for storing metadata. The first time it runs with the `editorial_workflow` setup, it creates a new ref called `meta/_netlify_cms`, pointing to an empty, orphan tree.
|
||||||
|
|
||||||
Actual data are stored in individual `json` files committed to this tree.
|
Actual data are stored in individual `json` files committed to this tree.
|
||||||
|
@ -9,20 +9,16 @@ We run new functionality in an open beta format from time to time. That means th
|
|||||||
**Use these features at your own risk.**
|
**Use these features at your own risk.**
|
||||||
|
|
||||||
## Custom Mount Element
|
## Custom Mount Element
|
||||||
Netlify CMS always creates it's own DOM element for mounting the application, which means it always
|
Netlify CMS always creates its own DOM element for mounting the application, which means it always takes over the entire page, and is generally inflexible if you're trying to do something creative, like injecting it into a shared context.
|
||||||
takes over the entire page, and is generally inflexible if you're trying to do something creative,
|
|
||||||
like injecting it into a shared context.
|
|
||||||
|
|
||||||
You can now provide your own element for Netlify CMS to mount in by setting the target element's ID
|
You can now provide your own element for Netlify CMS to mount in by setting the target element's ID as `nc-root`. If Netlify CMS finds an element with this ID during initialization, it will mount within that element instead of creating its own.
|
||||||
as `nc-root`. If Netlify CMS finds an element with this ID during initialization, it will mount
|
|
||||||
within that element instead of creating it's own.
|
|
||||||
|
|
||||||
## Manual Initialization
|
## Manual Initialization
|
||||||
Netlify CMS can now be manually initialized, rather than automatically loading up the moment you import it. The whole point of this at the moment is to inject configuration into Netlify CMS before it loads, bypassing need for an actual Netlify CMS `config.yml`. This is important, for example, when creating tight integrations with static site generators.
|
Netlify CMS can now be manually initialized, rather than automatically loading up the moment you import it. The whole point of this at the moment is to inject configuration into Netlify CMS before it loads, bypassing need for an actual Netlify CMS `config.yml`. This is important, for example, when creating tight integrations with static site generators.
|
||||||
|
|
||||||
Injecting config is technically already possible by setting `window.CMS_CONFIG` before importing/requiring/running Netlify CMS, but most projects are modular and don't want to use globals, plus `window.CMS_CONFIG` is an internal, not technically supported, and provides no validation.
|
Injecting config is technically already possible by setting `window.CMS_CONFIG` before importing/requiring/running Netlify CMS, but most projects are modular and don't want to use globals, plus `window.CMS_CONFIG` is an internal, not technically supported, and provides no validation.
|
||||||
|
|
||||||
Assuming you have the netlify-cms package installed to your project, manual initialization works like so:
|
Assuming you have the netlify-cms package installed to your project, manual initialization works like this:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// This global flag enables manual initialization.
|
// This global flag enables manual initialization.
|
||||||
@ -48,7 +44,7 @@ init()
|
|||||||
* not concatenated.
|
* not concatenated.
|
||||||
*
|
*
|
||||||
* For example, the code below contains an incomplete config, but using it,
|
* For example, the code below contains an incomplete config, but using it,
|
||||||
* your `config.yml` can be missing it's backend property, allowing you
|
* your `config.yml` can be missing its backend property, allowing you
|
||||||
* to set this property at runtime.
|
* to set this property at runtime.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -65,7 +61,7 @@ CMS.registerPreviewTemplate(...);
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Raw CSS in `registerPreviewStyle`
|
## Raw CSS in `registerPreviewStyle`
|
||||||
`registerPreviewStyle` can now accept a CSS string, in addition to accepting a url. The feature is activated by passing in an object as the second argument, with `raw` set to a truthy value.This is critical for integrating with modern build tooling. Here's an example using webpack:
|
`registerPreviewStyle` can now accept a CSS string, in addition to accepting a url. The feature is activated by passing in an object as the second argument, with `raw` set to a truthy value. This is critical for integrating with modern build tooling. Here's an example using webpack:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
/**
|
/**
|
||||||
@ -79,7 +75,7 @@ CMS.registerPreviewStyle(styles.toString(), { raw: true })
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Squash merge GitHub pull requests
|
## Squash merge GitHub pull requests
|
||||||
When using the [Editorial Workflow](/docs/configuration-options/#publish-mode) with the `github` or GitHub-connected `git-gateway` backends, Netlify CMS creates a pull request for each unpublished entry. Every time the unpublished entry is changed and saved, a new commit is added to the pull request. When the entry is published, the pull request is merged, and all of those commits are added to your project commit history in a merge commit.
|
When using the [Editorial Workflow](../configuration-options/#publish-mode) with the `github` or GitHub-connected `git-gateway` backends, Netlify CMS creates a pull request for each unpublished entry. Every time the unpublished entry is changed and saved, a new commit is added to the pull request. When the entry is published, the pull request is merged, and all of those commits are added to your project commit history in a merge commit.
|
||||||
|
|
||||||
The squash merge option causes all commits to be "squashed" into a single commit when the pull request is merged, and the resulting commit is rebased onto the target branch, avoiding the merge commit altogether.
|
The squash merge option causes all commits to be "squashed" into a single commit when the pull request is merged, and the resulting commit is rebased onto the target branch, avoiding the merge commit altogether.
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ Alternatively, you can specify a custom config file using a link tag:
|
|||||||
<link href="path/to/config.yml" type="text/yaml" rel="cms-config-url">
|
<link href="path/to/config.yml" type="text/yaml" rel="cms-config-url">
|
||||||
```
|
```
|
||||||
|
|
||||||
To see working configuration examples, you can [start from a template](https://www.netlifycms.org/docs/start-with-a-template) or check out 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) to see how each option was configured.
|
To see working configuration examples, you can [start from a template](../start-with-a-template) or check out 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) to see how each option was configured.
|
||||||
|
|
||||||
You can find details about all configuration options below. 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.
|
You can find details about all configuration options below. 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.
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ You can find details about all configuration options below. Note that [YAML synt
|
|||||||
|
|
||||||
*This setting is required.*
|
*This setting is required.*
|
||||||
|
|
||||||
The `backend` option specifies how to access the content for your site, including authentication. Full details and code samples can be found in [Authentication & Backends](https://www.netlifycms.org/docs/authentication-backends).
|
The `backend` option specifies how to access the content for your site, including authentication. Full details and code samples can be found in [Authentication & Backends](../authentication-backends).
|
||||||
|
|
||||||
**Note**: no matter where you access Netlify CMS — whether running locally, in a staging environment, or in your published site — it will always fetch and commit files in your hosted repository (for example, on GitHub), on the branch you configured in your Netlify CMS config.yml file. This means that content fetched in the admin UI will match the content in the repository, which may be different from your locally running site. It also means that content saved using the admin UI will save directly to the hosted repository, even if you're running the UI locally or in staging.
|
**Note**: no matter where you access Netlify CMS — whether running locally, in a staging environment, or in your published site — it will always fetch and commit files in your hosted repository (for example, on GitHub), on the branch you configured in your Netlify CMS config.yml file. This means that content fetched in the admin UI will match the content in the repository, which may be different from your locally running site. It also means that content saved using the admin UI will save directly to the hosted repository, even if you're running the UI locally or in staging.
|
||||||
|
|
||||||
@ -107,11 +107,11 @@ The `collections` setting is the heart of your Netlify CMS configuration, as it
|
|||||||
|
|
||||||
`collections` accepts a list of collection objects, each with the following options:
|
`collections` accepts a list of collection objects, each with the following options:
|
||||||
|
|
||||||
- `name` (required): unique identifier for the collection, used as the key when referenced in other contexts (like the [relation widget](https://www.netlifycms.org/docs/widgets/#relation))
|
- `name` (required): unique identifier for the collection, used as the key when referenced in other contexts (like the [relation widget](../widgets/#relation))
|
||||||
- `Label`: label for the collection in the editor UI; defaults to the value of `name`
|
- `Label`: label for the collection in the editor UI; defaults to the value of `name`
|
||||||
- `label_singular`: singular label for certain elements in the editor; defaults to the value of `label`
|
- `label_singular`: singular label for certain elements in the editor; defaults to the value of `label`
|
||||||
- `file` or `folder` (requires one of these): specifies the collection type and location; details in [Collection Types](https://www.netlifycms.org/docs/collection-types)
|
- `file` or `folder` (requires one of these): specifies the collection type and location; details in [Collection Types](../collection-types)
|
||||||
- `filter`: optional filter for `folder` collections; details in [Collection Types](https://www.netlifycms.org/docs/collection-types)
|
- `filter`: optional filter for `folder` collections; details in [Collection Types](../collection-types)
|
||||||
- `create`: for `folder` collections only; `true` allows users to create new items in the collection; defaults to `false`
|
- `create`: for `folder` collections only; `true` allows users to create new items in the collection; defaults to `false`
|
||||||
- `delete`: `false` prevents users from deleting items in a collection; defaults to `true`
|
- `delete`: `false` prevents users from deleting items in a collection; defaults to `true`
|
||||||
- `extension`: see detailed description below
|
- `extension`: see detailed description below
|
||||||
@ -170,12 +170,12 @@ The `fields` option maps editor UI widgets to field-value pairs in the saved fil
|
|||||||
|
|
||||||
`fields` accepts a list of collection objects, each with the following options:
|
`fields` accepts a list of collection objects, each with the following options:
|
||||||
|
|
||||||
- `name` (required): unique identifier for the field, used as the key when referenced in other contexts (like the [relation widget](https://www.netlifycms.org/docs/widgets/#relation))
|
- `name` (required): unique identifier for the field, used as the key when referenced in other contexts (like the [relation widget](../widgets/#relation))
|
||||||
- `label`: label for the field in the editor UI; defaults to the value of `name`
|
- `label`: label for the field in the editor UI; defaults to the value of `name`
|
||||||
- `widget`: defines editor UI and inputs and file field data types; details in [Widgets](https://www.netlifycms.org/docs/widgets)
|
- `widget`: defines editor UI and inputs and file field data types; details in [Widgets](../widgets)
|
||||||
- `default`: specify a default value for a field; available for most widget types (see [Widgets](https://www.netlifycms.org/docs/widgets) for details on each widget type)
|
- `default`: specify a default value for a field; available for most widget types (see [Widgets](../widgets) for details on each widget type)
|
||||||
- `required`: specify as `false` to make a field optional; defaults to `true`
|
- `required`: specify as `false` to make a field optional; defaults to `true`
|
||||||
- `pattern`: add field validation by specifying a list with a regex pattern and an error message; more extensive validation can be achieved with [custom widgets](https://www.netlifycms.org/docs/custom-widgets/#advanced-field-validation)
|
- `pattern`: add field validation by specifying a list with a regex pattern and an error message; more extensive validation can be achieved with [custom widgets](../custom-widgets/#advanced-field-validation)
|
||||||
|
|
||||||
In files with frontmatter, one field should be named `body`. This special field represents the section of the document (usually markdown) that comes after the frontmatter.
|
In files with frontmatter, one field should be named `body`. This special field represents the section of the document (usually markdown) that comes after the frontmatter.
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ group: guides
|
|||||||
|
|
||||||
The NetlifyCMS exposes a `window.CMS` global object that you can use to register custom widgets, previews, and editor plugins. The same object is also the default export if you import Netify CMS as an npm module. The available widget extension methods are:
|
The NetlifyCMS exposes a `window.CMS` global object that you can use to register custom widgets, previews, and editor plugins. The same object is also the default export if you import Netify CMS as an npm module. The available widget extension methods are:
|
||||||
|
|
||||||
* **registerWidget:** lets you register a custom widget.
|
* **registerWidget:** registers a custom widget.
|
||||||
* **registerEditorComponent:** lets you add a block component to the Markdown editor.
|
* **registerEditorComponent:** adds a block component to the Markdown editor.
|
||||||
|
|
||||||
### Writing React Components inline
|
### Writing React Components inline
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ CMS.registerEditorComponent({
|
|||||||
|
|
||||||
## Advanced field validation
|
## Advanced field validation
|
||||||
|
|
||||||
All widget fields, including those for built-in widgets, [include basic validation](https://www.netlifycms.org/docs/widgets/#common-widget-options) capability using the `required` and `pattern` options.
|
All widget fields, including those for built-in widgets, [include basic validation](../widgets/#common-widget-options) capability using the `required` and `pattern` options.
|
||||||
|
|
||||||
With custom widgets, the widget control can also optionally implement an `isValid` method to perform custom validations, in addition to presence and pattern. The `isValid` method will be automatically called, and it can return either a boolean value, an object with an error message or a promise. Examples:
|
With custom widgets, the widget control can also optionally implement an `isValid` method to perform custom validations, in addition to presence and pattern. The `isValid` method will be automatically called, and it can return either a boolean value, an object with an error message or a promise. Examples:
|
||||||
|
|
||||||
@ -167,4 +167,4 @@ You can also return a promise from `isValid`. While the promise is pending, the
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: Do not create a promise inside `isValid` - `isValid` is called right before trying to persist. This means that even if a previous promise was already resolved, when the user hits 'save', `isValid` will be called again. If it returns a new promise, it will be immediately marked as "in error" until the new promise resolves.
|
**Note:** Do not create a promise inside `isValid` - `isValid` is called right before trying to persist. This means that even if a previous promise was already resolved, when the user hits 'save', `isValid` will be called again. If it returns a new promise, it will be immediately marked as "in error" until the new promise resolves.
|
||||||
|
@ -88,13 +88,8 @@ Registers a template for a collection.
|
|||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
### Lists and Objects
|
### Lists and Objects
|
||||||
The API for accessing the individual fields of list- and object-type entries is similar to the API
|
The API for accessing the individual fields of list- and object-type entries is similar to the API for accessing fields in standard entries, but there are a few key differences. Access to these nested fields is facilitated through the `widgetsFor` function, which is passed to the preview template component during render.
|
||||||
for accessing fields in standard entries, but there are a few key differences. Access to these
|
**Note**: as is often the case with the NetlifyCMS API, arrays and objects are created with Immutable.js. If some of the methods that we use are unfamiliar, such as `getIn`, check out [their docs](https://facebook.github.io/immutable-js/docs/#/) to get a better understanding.
|
||||||
nested fields is facilitated through the `widgetsFor` function, which is passed to the preview
|
|
||||||
template component during render.
|
|
||||||
**Note**: as is often the case with the NetlifyCMS API, arrays and objects are created with
|
|
||||||
Immutable.js. If some of the methods that we use are unfamiliar, such as `getIn`, check out
|
|
||||||
[their docs](https://facebook.github.io/immutable-js/docs/#/) to get a better understanding.
|
|
||||||
**List Example:**
|
**List Example:**
|
||||||
```html
|
```html
|
||||||
<script>
|
<script>
|
||||||
@ -171,8 +166,7 @@ Registers a template for a collection.
|
|||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
### Accessing Metadata
|
### Accessing Metadata
|
||||||
Preview Components also receive an additional prop: `fieldsMetaData`. It contains aditional information (besides the plain plain textual value of each field) that can be useful for preview purposes.
|
Preview Components also receive an additional prop: `fieldsMetaData`. It contains aditional information (besides the plain plain textual value of each field) that can be useful for preview purposes. For example, the Relation widget passes the whole selected relation data in `fieldsMetaData`.
|
||||||
For example, the Relation widget passes the whole selected relation data in `fieldsMetaData`.
|
|
||||||
```js
|
```js
|
||||||
export default class ArticlePreview extends React.Component {
|
export default class ArticlePreview extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
|
@ -4,7 +4,7 @@ weight: 30
|
|||||||
group: reference
|
group: reference
|
||||||
---
|
---
|
||||||
|
|
||||||
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 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](../custom-widgets)!
|
||||||
|
|
||||||
Widgets are specified as collection fields in the Netlify CMS `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.
|
Widgets are specified as collection fields in the Netlify CMS `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.
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ The following options are available on all fields:
|
|||||||
|
|
||||||
- `required`: specify as `false` to make a field optional; defaults to `true`
|
- `required`: specify as `false` to make a field optional; defaults to `true`
|
||||||
- `hint`: optionally add helper text directly below a widget. Useful for including instructions.
|
- `hint`: optionally add helper text directly below a widget. Useful for including instructions.
|
||||||
- `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)
|
- `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](../custom-widgets/#advanced-field-validation)
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- label: "Title"
|
- label: "Title"
|
||||||
|
@ -5,7 +5,7 @@ target: markdown
|
|||||||
|
|
||||||
The markdown widget provides a full fledged text editor - which is based on [slate](https://github.com/ianstormtaylor/slate) - that allows users to format text with features such as headings and blockquotes. Users are also allowed to write in markdown by simply flipping a switch.
|
The markdown widget provides a full fledged text editor - which is based on [slate](https://github.com/ianstormtaylor/slate) - that allows users to format text with features such as headings and blockquotes. Users are also allowed to write in markdown by simply flipping a switch.
|
||||||
|
|
||||||
*Please note:* in case you want to use your markdown editor to fill a markdown's file content after the frontmatter, you'll have name the field as `body` so then the CMS can recognize it and save the file accordingly.
|
*Please note:* in case you want to use your markdown editor to fill a markdown's file content after the frontmatter, you'll have name the field as `body` so that the CMS can recognize it and save the file accordingly.
|
||||||
|
|
||||||
- **Name:** `markdown`
|
- **Name:** `markdown`
|
||||||
- **UI:** full text editor
|
- **UI:** full text editor
|
||||||
|
Loading…
x
Reference in New Issue
Block a user