docs(fix): revert prettier formatting on markdown files (#1612)
Prettier formatting our markdown files is causing bugs because of the differences between Gatsby's parser and Prettier's. Also, Prettier formats the inline code-blocks containing example CMS configs, but the formatting it uses doesn't really make much sense or match the suggested CMS config style. It doesn't actually make much sense to format the docs anyway, since we use the CMS itself to edit/generate them.
This commit is contained in:
parent
dd56d6e2d9
commit
ebc2471c6b
@ -1,3 +1,2 @@
|
|||||||
dist/
|
dist/
|
||||||
bin/
|
bin/
|
||||||
CHANGELOG.md
|
|
@ -14,21 +14,21 @@ orientation.
|
|||||||
Examples of behavior that contributes to creating a positive environment
|
Examples of behavior that contributes to creating a positive environment
|
||||||
include:
|
include:
|
||||||
|
|
||||||
- Using welcoming and inclusive language
|
* Using welcoming and inclusive language
|
||||||
- Being respectful of differing viewpoints and experiences
|
* Being respectful of differing viewpoints and experiences
|
||||||
- Gracefully accepting constructive criticism
|
* Gracefully accepting constructive criticism
|
||||||
- Focusing on what is best for the community
|
* Focusing on what is best for the community
|
||||||
- Showing empathy towards other community members
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
advances
|
advances
|
||||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
- Public or private harassment
|
* Public or private harassment
|
||||||
- Publishing others' private information, such as a physical or electronic
|
* Publishing others' private information, such as a physical or electronic
|
||||||
address, without explicit permission
|
address, without explicit permission
|
||||||
- Other conduct which could reasonably be considered inappropriate in a
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
professional setting
|
professional setting
|
||||||
|
|
||||||
## Our Responsibilities
|
## Our Responsibilities
|
||||||
|
10
README.md
10
README.md
@ -1,5 +1,4 @@
|
|||||||
# Netlify CMS
|
# Netlify CMS
|
||||||
|
|
||||||
[![All Contributors](https://img.shields.io/badge/all_contributors-113-orange.svg)](#contributors)
|
[![All Contributors](https://img.shields.io/badge/all_contributors-113-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)
|
||||||
@ -25,9 +24,9 @@ Read more about Netlify CMS [Core Concepts](https://www.netlifycms.org/docs/intr
|
|||||||
|
|
||||||
The Netlify CMS can be used in two different ways.
|
The Netlify CMS can be used in two different ways.
|
||||||
|
|
||||||
- A Quick and easy install, that just requires you to create a single HTML file and a configuration file. All the CMS Javascript and CSS are loaded from a CDN.
|
* A Quick and easy install, that just requires you to create a single HTML file and a configuration file. All the CMS Javascript and CSS are loaded from a CDN.
|
||||||
To learn more about this installation method, refer to the [Quick Start Guide](https://www.netlifycms.org/docs/quick-start/)
|
To learn more about this installation method, refer to the [Quick Start Guide](https://www.netlifycms.org/docs/quick-start/)
|
||||||
- A complete, more complex install, that gives you more flexibility but requires that you use a static site builder with a build system that supports npm packages.
|
* A complete, more complex install, that gives you more flexibility but requires that you use a static site builder with a build system that supports npm packages.
|
||||||
|
|
||||||
# Community
|
# Community
|
||||||
|
|
||||||
@ -46,9 +45,7 @@ Please make sure you understand its [implications and guarantees](https://writin
|
|||||||
# Thanks
|
# Thanks
|
||||||
|
|
||||||
## Services
|
## Services
|
||||||
|
|
||||||
These services support Netlify CMS development by providing free infrastructure.
|
These services support Netlify CMS development by providing free infrastructure.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="https://www.travis-ci.org">
|
<a href="https://www.travis-ci.org">
|
||||||
<img src="https://raw.githubusercontent.com/netlify/netlify-cms/master/img/travis.png" height="38"/>
|
<img src="https://raw.githubusercontent.com/netlify/netlify-cms/master/img/travis.png" height="38"/>
|
||||||
@ -60,10 +57,8 @@ These services support Netlify CMS development by providing free infrastructure.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
These wonderful folks are responsible for developing and maintaining Netlify CMS. ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key))
|
These wonderful folks are responsible for developing and maintaining Netlify CMS. ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key))
|
||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
| [<img src="https://avatars2.githubusercontent.com/u/33676?v=4" width="100px;"/><br /><sub><b>Cássio Souza</b></sub>](https://twitter.com/cassiozen)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=cassiozen "Code") | [<img src="https://avatars3.githubusercontent.com/u/2112202?v=4" width="100px;"/><br /><sub><b>Shawn Erquhart</b></sub>](https://erquh.art)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=erquhart "Code") | [<img src="https://avatars3.githubusercontent.com/u/11071?v=4" width="100px;"/><br /><sub><b>Andrey Okonetchnikov</b></sub>](http://okonet.ru)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=okonet "Code") | [<img src="https://avatars0.githubusercontent.com/u/6515?v=4" width="100px;"/><br /><sub><b>Mathias Biilmann</b></sub>](https://www.netlify.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=biilmann "Code") | [<img src="https://avatars1.githubusercontent.com/u/1425133?v=4" width="100px;"/><br /><sub><b>Benaiah Mischenko</b></sub>](http://benaiah.me)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=Benaiah "Code") | [<img src="https://avatars0.githubusercontent.com/u/2281080?v=4" width="100px;"/><br /><sub><b>Rafael Conde</b></sub>](http://rafaelconde.net)<br />[🎨](#design-rafaelconde "Design") [💻](https://github.com/netlify/netlify-cms/commits?author=rafaelconde "Code") | [<img src="https://avatars0.githubusercontent.com/u/2513147?v=4" width="100px;"/><br /><sub><b>Joseph Earl</b></sub>](http://josephearl.co.uk)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=josephearl "Code") |
|
| [<img src="https://avatars2.githubusercontent.com/u/33676?v=4" width="100px;"/><br /><sub><b>Cássio Souza</b></sub>](https://twitter.com/cassiozen)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=cassiozen "Code") | [<img src="https://avatars3.githubusercontent.com/u/2112202?v=4" width="100px;"/><br /><sub><b>Shawn Erquhart</b></sub>](https://erquh.art)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=erquhart "Code") | [<img src="https://avatars3.githubusercontent.com/u/11071?v=4" width="100px;"/><br /><sub><b>Andrey Okonetchnikov</b></sub>](http://okonet.ru)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=okonet "Code") | [<img src="https://avatars0.githubusercontent.com/u/6515?v=4" width="100px;"/><br /><sub><b>Mathias Biilmann</b></sub>](https://www.netlify.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=biilmann "Code") | [<img src="https://avatars1.githubusercontent.com/u/1425133?v=4" width="100px;"/><br /><sub><b>Benaiah Mischenko</b></sub>](http://benaiah.me)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=Benaiah "Code") | [<img src="https://avatars0.githubusercontent.com/u/2281080?v=4" width="100px;"/><br /><sub><b>Rafael Conde</b></sub>](http://rafaelconde.net)<br />[🎨](#design-rafaelconde "Design") [💻](https://github.com/netlify/netlify-cms/commits?author=rafaelconde "Code") | [<img src="https://avatars0.githubusercontent.com/u/2513147?v=4" width="100px;"/><br /><sub><b>Joseph Earl</b></sub>](http://josephearl.co.uk)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=josephearl "Code") |
|
||||||
@ -85,6 +80,5 @@ These wonderful folks are responsible for developing and maintaining Netlify CMS
|
|||||||
| [<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://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") |
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
||||||
<!-- prettier-ignore-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!
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
"dryrun": "lerna publish --skip-npm --skip-git",
|
"dryrun": "lerna publish --skip-npm --skip-git",
|
||||||
"publish": "run-s bootstrap dryrun build && git checkout . && lerna publish",
|
"publish": "run-s bootstrap dryrun build && git checkout . && lerna publish",
|
||||||
"format": "run-s \"lint:css -- --fix --quiet\" \"lint:js -- --fix --quiet\" \"format:prettier -- --write\"",
|
"format": "run-s \"lint:css -- --fix --quiet\" \"lint:js -- --fix --quiet\" \"format:prettier -- --write\"",
|
||||||
"format:prettier": "prettier \"{{packages,scripts,website}/**/,}*.{js,css,json,yml,yaml}\"",
|
"format:prettier": "prettier \"{{packages,scripts,website}/**/,}*.{js,css}\"",
|
||||||
"lint": "run-p -c --aggregate-output lint:*",
|
"lint": "run-p -c --aggregate-output lint:*",
|
||||||
"lint-quiet": "run-p -c --aggregate-output \"lint:* -- --quiet\"",
|
"lint-quiet": "run-p -c --aggregate-output \"lint:* -- --quiet\"",
|
||||||
"lint:css": "stylelint --ignore-path .gitignore \"{packages/**/*.{css,js},website/**/*.css}\"",
|
"lint:css": "stylelint --ignore-path .gitignore \"{packages/**/*.{css,js},website/**/*.css}\"",
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
# Netlify CMS
|
# Netlify CMS
|
||||||
|
[![All Contributors](https://img.shields.io/badge/all_contributors-113-orange.svg)](#contributors)
|
||||||
[![All Contributors](https://img.shields.io/badge/all_contributors-110-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)
|
||||||
|
|
||||||
@ -25,9 +24,9 @@ Read more about Netlify CMS [Core Concepts](https://www.netlifycms.org/docs/intr
|
|||||||
|
|
||||||
The Netlify CMS can be used in two different ways.
|
The Netlify CMS can be used in two different ways.
|
||||||
|
|
||||||
- A Quick and easy install, that just requires you to create a single HTML file and a configuration file. All the CMS Javascript and CSS are loaded from a CDN.
|
* A Quick and easy install, that just requires you to create a single HTML file and a configuration file. All the CMS Javascript and CSS are loaded from a CDN.
|
||||||
To learn more about this installation method, refer to the [Quick Start Guide](https://www.netlifycms.org/docs/quick-start/)
|
To learn more about this installation method, refer to the [Quick Start Guide](https://www.netlifycms.org/docs/quick-start/)
|
||||||
- A complete, more complex install, that gives you more flexibility but requires that you use a static site builder with a build system that supports npm packages.
|
* A complete, more complex install, that gives you more flexibility but requires that you use a static site builder with a build system that supports npm packages.
|
||||||
|
|
||||||
# Community
|
# Community
|
||||||
|
|
||||||
@ -46,9 +45,7 @@ Please make sure you understand its [implications and guarantees](https://writin
|
|||||||
# Thanks
|
# Thanks
|
||||||
|
|
||||||
## Services
|
## Services
|
||||||
|
|
||||||
These services support Netlify CMS development by providing free infrastructure.
|
These services support Netlify CMS development by providing free infrastructure.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a href="https://www.travis-ci.org">
|
<a href="https://www.travis-ci.org">
|
||||||
<img src="https://raw.githubusercontent.com/netlify/netlify-cms/master/img/travis.png" height="38"/>
|
<img src="https://raw.githubusercontent.com/netlify/netlify-cms/master/img/travis.png" height="38"/>
|
||||||
@ -60,10 +57,8 @@ These services support Netlify CMS development by providing free infrastructure.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
These wonderful folks are responsible for developing and maintaining Netlify CMS. ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key))
|
These wonderful folks are responsible for developing and maintaining Netlify CMS. ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key))
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
| [<img src="https://avatars2.githubusercontent.com/u/33676?v=4" width="100px;"/><br /><sub><b>Cássio Souza</b></sub>](https://twitter.com/cassiozen)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=cassiozen "Code") | [<img src="https://avatars3.githubusercontent.com/u/2112202?v=4" width="100px;"/><br /><sub><b>Shawn Erquhart</b></sub>](https://erquh.art)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=erquhart "Code") | [<img src="https://avatars3.githubusercontent.com/u/11071?v=4" width="100px;"/><br /><sub><b>Andrey Okonetchnikov</b></sub>](http://okonet.ru)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=okonet "Code") | [<img src="https://avatars0.githubusercontent.com/u/6515?v=4" width="100px;"/><br /><sub><b>Mathias Biilmann</b></sub>](https://www.netlify.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=biilmann "Code") | [<img src="https://avatars1.githubusercontent.com/u/1425133?v=4" width="100px;"/><br /><sub><b>Benaiah Mischenko</b></sub>](http://benaiah.me)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=Benaiah "Code") | [<img src="https://avatars0.githubusercontent.com/u/2281080?v=4" width="100px;"/><br /><sub><b>Rafael Conde</b></sub>](http://rafaelconde.net)<br />[🎨](#design-rafaelconde "Design") [💻](https://github.com/netlify/netlify-cms/commits?author=rafaelconde "Code") | [<img src="https://avatars0.githubusercontent.com/u/2513147?v=4" width="100px;"/><br /><sub><b>Joseph Earl</b></sub>](http://josephearl.co.uk)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=josephearl "Code") |
|
| [<img src="https://avatars2.githubusercontent.com/u/33676?v=4" width="100px;"/><br /><sub><b>Cássio Souza</b></sub>](https://twitter.com/cassiozen)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=cassiozen "Code") | [<img src="https://avatars3.githubusercontent.com/u/2112202?v=4" width="100px;"/><br /><sub><b>Shawn Erquhart</b></sub>](https://erquh.art)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=erquhart "Code") | [<img src="https://avatars3.githubusercontent.com/u/11071?v=4" width="100px;"/><br /><sub><b>Andrey Okonetchnikov</b></sub>](http://okonet.ru)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=okonet "Code") | [<img src="https://avatars0.githubusercontent.com/u/6515?v=4" width="100px;"/><br /><sub><b>Mathias Biilmann</b></sub>](https://www.netlify.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=biilmann "Code") | [<img src="https://avatars1.githubusercontent.com/u/1425133?v=4" width="100px;"/><br /><sub><b>Benaiah Mischenko</b></sub>](http://benaiah.me)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=Benaiah "Code") | [<img src="https://avatars0.githubusercontent.com/u/2281080?v=4" width="100px;"/><br /><sub><b>Rafael Conde</b></sub>](http://rafaelconde.net)<br />[🎨](#design-rafaelconde "Design") [💻](https://github.com/netlify/netlify-cms/commits?author=rafaelconde "Code") | [<img src="https://avatars0.githubusercontent.com/u/2513147?v=4" width="100px;"/><br /><sub><b>Joseph Earl</b></sub>](http://josephearl.co.uk)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=josephearl "Code") |
|
||||||
@ -82,8 +77,8 @@ These wonderful folks are responsible for developing and maintaining Netlify CMS
|
|||||||
| [<img src="https://avatars2.githubusercontent.com/u/283419?v=4" width="100px;"/><br /><sub><b>Tim Carry</b></sub>](http://www.pixelastic.com/)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Code") [🎨](#design-pixelastic "Design") [📖](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/30510616?v=4" width="100px;"/><br /><sub><b>Sol Park</b></sub>](https://github.com/solpark)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=solpark "Code") | [<img src="https://avatars0.githubusercontent.com/u/29218846?v=4" width="100px;"/><br /><sub><b>Michael Romani</b></sub>](https://github.com/MichaelRomani)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=MichaelRomani "Code") | [<img src="https://avatars1.githubusercontent.com/u/15175868?v=4" width="100px;"/><br /><sub><b>Xifeng Jin</b></sub>](http://linkedin/in/xifengjin88)<br />[🐛](https://github.com/netlify/netlify-cms/issues?q=author%3Axifengjin88 "Bug reports") [💻](https://github.com/netlify/netlify-cms/commits?author=xifengjin88 "Code") | [<img src="https://avatars1.githubusercontent.com/u/372831?v=4" width="100px;"/><br /><sub><b>Pedro Duarte</b></sub>](http://pedroduarte.me)<br />[🐛](https://github.com/netlify/netlify-cms/issues?q=author%3Apeduarte "Bug reports") [💻](https://github.com/netlify/netlify-cms/commits?author=peduarte "Code") [📖](https://github.com/netlify/netlify-cms/commits?author=peduarte "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/6064830?v=4" width="100px;"/><br /><sub><b>Antonio Argote</b></sub>](http://antonioargote.com)<br />[🎨](#design-Strangehill "Design") | [<img src="https://avatars3.githubusercontent.com/u/1479451?v=4" width="100px;"/><br /><sub><b>Kristaps Taube</b></sub>](https://www.ktaube.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=ktaube "Code") |
|
| [<img src="https://avatars2.githubusercontent.com/u/283419?v=4" width="100px;"/><br /><sub><b>Tim Carry</b></sub>](http://www.pixelastic.com/)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Code") [🎨](#design-pixelastic "Design") [📖](https://github.com/netlify/netlify-cms/commits?author=pixelastic "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/30510616?v=4" width="100px;"/><br /><sub><b>Sol Park</b></sub>](https://github.com/solpark)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=solpark "Code") | [<img src="https://avatars0.githubusercontent.com/u/29218846?v=4" width="100px;"/><br /><sub><b>Michael Romani</b></sub>](https://github.com/MichaelRomani)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=MichaelRomani "Code") | [<img src="https://avatars1.githubusercontent.com/u/15175868?v=4" width="100px;"/><br /><sub><b>Xifeng Jin</b></sub>](http://linkedin/in/xifengjin88)<br />[🐛](https://github.com/netlify/netlify-cms/issues?q=author%3Axifengjin88 "Bug reports") [💻](https://github.com/netlify/netlify-cms/commits?author=xifengjin88 "Code") | [<img src="https://avatars1.githubusercontent.com/u/372831?v=4" width="100px;"/><br /><sub><b>Pedro Duarte</b></sub>](http://pedroduarte.me)<br />[🐛](https://github.com/netlify/netlify-cms/issues?q=author%3Apeduarte "Bug reports") [💻](https://github.com/netlify/netlify-cms/commits?author=peduarte "Code") [📖](https://github.com/netlify/netlify-cms/commits?author=peduarte "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/6064830?v=4" width="100px;"/><br /><sub><b>Antonio Argote</b></sub>](http://antonioargote.com)<br />[🎨](#design-Strangehill "Design") | [<img src="https://avatars3.githubusercontent.com/u/1479451?v=4" width="100px;"/><br /><sub><b>Kristaps Taube</b></sub>](https://www.ktaube.com)<br />[💻](https://github.com/netlify/netlify-cms/commits?author=ktaube "Code") |
|
||||||
| [<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://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") |
|
||||||
<!-- 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!
|
||||||
|
@ -9,20 +9,19 @@ description: >-
|
|||||||
of features.
|
of features.
|
||||||
date: '2018-07-26'
|
date: '2018-07-26'
|
||||||
---
|
---
|
||||||
|
Today we’re releasing Netlify CMS 2.0, which adds support for using Bitbucket as a backend.
|
||||||
|
|
||||||
Today we’re releasing Netlify CMS 2.0, which adds support for using Bitbucket as a backend.
|
With this release, [Netlify CMS](https://www.netlifycms.org/) now supports all major Git collaboration providers, adding Bitbucket to the list of supported providers which already includes GitLab and GitHub.
|
||||||
|
|
||||||
With this release, [Netlify CMS](https://www.netlifycms.org/) now supports all major Git collaboration providers, adding Bitbucket to the list of supported providers which already includes GitLab and GitHub.
|
While you could already use Netlify CMS with most static site generators, our long-term vision is to be tool-agnostic so you can use whatever tool helps you work best. The latest release brings us one step closer by giving the option of an open source, Git-centric CMS to tens of thousands of businesses that depend on Bitbucket, including 60 of the Fortune 100.
|
||||||
|
|
||||||
While you could already use Netlify CMS with most static site generators, our long-term vision is to be tool-agnostic so you can use whatever tool helps you work best. The latest release brings us one step closer by giving the option of an open source, Git-centric CMS to tens of thousands of businesses that depend on Bitbucket, including 60 of the Fortune 100.
|
|
||||||
|
|
||||||
## Becoming a Monorepo
|
## Becoming a Monorepo
|
||||||
|
|
||||||
The other big change with 2.0 is the migration from a single codebase to a collection of interdependent packages called a “monorepo”. Netlify CMS still lives in a [single repository on GitHub](https://github.com/netlify/netlify-cms), but the many extensions that were kept within Netlify CMS itself are now completely separate from the application core. This brings a few benefits:
|
The other big change with 2.0 is the migration from a single codebase to a collection of interdependent packages called a “monorepo”. Netlify CMS still lives in a [single repository on GitHub](https://github.com/netlify/netlify-cms), but the many extensions that were kept within Netlify CMS itself are now completely separate from the application core. This brings a few benefits:
|
||||||
|
|
||||||
- Extension authors can easily copy an existing extension from the Netlify CMS repo and create a custom version.
|
* Extension authors can easily copy an existing extension from the Netlify CMS repo and create a custom version.
|
||||||
- Your custom extensions can now do anything the “official” extensions can do (because official extensions are no longer taking advantage of privileged internal code).
|
* Your custom extensions can now do anything the “official” extensions can do (because official extensions are no longer taking advantage of privileged internal code).
|
||||||
- The monorepo approach provides a foundation that will encourage a more modular CMS, with shared parts that make extension authoring easier.
|
* The monorepo approach provides a foundation that will encourage a more modular CMS, with shared parts that make extension authoring easier.
|
||||||
|
|
||||||
## What’s next
|
## What’s next
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ description: >-
|
|||||||
GitHub.
|
GitHub.
|
||||||
date: '2018-06-13'
|
date: '2018-06-13'
|
||||||
---
|
---
|
||||||
|
|
||||||
Netlify CMS is releasing support for GitLab as a backend, creating the world's first completely open source stack for Git-based content editing.
|
Netlify CMS is releasing support for GitLab as a backend, creating the world's first completely open source stack for Git-based content editing.
|
||||||
|
|
||||||
<iframe width="100%" height="400" src="https://www.youtube.com/embed/ZrM3U0z8Sks?autoplay=1&loop=1&playlist=ZrM3U0z8Sks&mute=1&controls=0&modestbranding=1&showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
|
<iframe width="100%" height="400" src="https://www.youtube.com/embed/ZrM3U0z8Sks?autoplay=1&loop=1&playlist=ZrM3U0z8Sks&mute=1&controls=0&modestbranding=1&showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
|
||||||
@ -22,7 +21,7 @@ Adding support for GitLab means that millions more developers can now use Netlif
|
|||||||
|
|
||||||
Netlify CMS is an open source content management system for your Git workflow that enables you to provide editors with a friendly UI and intuitive workflow. You can use it with any static site generator to create faster, more flexible web projects. Content is stored in your GitLab repository alongside your code for easier versioning, multi-channel publishing, and the option to handle content updates directly in Git.
|
Netlify CMS is an open source content management system for your Git workflow that enables you to provide editors with a friendly UI and intuitive workflow. You can use it with any static site generator to create faster, more flexible web projects. Content is stored in your GitLab repository alongside your code for easier versioning, multi-channel publishing, and the option to handle content updates directly in Git.
|
||||||
|
|
||||||
In case you want an even easier way to get started, or just want to poke around in the code, you can use the button below to automatically deploy a starter site that uses the Hugo static site generator along with Netlify CMS.
|
In case you want an even easier way to get started, or just want to poke around in the code, you can use the button below to automatically deploy a starter site that uses the Hugo static site generator along with Netlify CMS.
|
||||||
|
|
||||||
<a href="https://app.netlify.com/start/deploy?repository=https://gitlab.com/netlify-templates/one-click-hugo-cms&stack=cms" rel="nofollow noreferrer noopener" target="_blank"><img src="https://www.netlify.com/img/deploy/button.svg" alt="Deploy to Netlify"></a>
|
<a href="https://app.netlify.com/start/deploy?repository=https://gitlab.com/netlify-templates/one-click-hugo-cms&stack=cms" rel="nofollow noreferrer noopener" target="_blank"><img src="https://www.netlify.com/img/deploy/button.svg" alt="Deploy to Netlify"></a>
|
||||||
|
|
||||||
|
@ -60,15 +60,15 @@ npm install netlify-cms --save
|
|||||||
Then import it (assuming your project has tooling for imports):
|
Then import it (assuming your project has tooling for imports):
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import CMS from 'netlify-cms';
|
import CMS from 'netlify-cms'
|
||||||
|
|
||||||
// Now the registry is available via the CMS object.
|
// Now the registry is available via the CMS object.
|
||||||
CMS.registerPreviewTemplate('my-template', MyTemplate);
|
CMS.registerPreviewTemplate('my-template', MyTemplate)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Configuration will be different for every site, so we'll break it down into parts. All code snippets in this section will be added to your `admin/config.yml` file.
|
Configuration will be different for every site, so we'll break it down into parts. All code snippets in this section will be added to your `admin/config.yml` file.
|
||||||
|
|
||||||
### Backend
|
### Backend
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ Netlify CMS allows users to upload images directly within the editor. For this t
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# This line should *not* be indented
|
# This line should *not* be indented
|
||||||
media_folder: 'images/uploads' # Media files will be stored in the repo under images/uploads
|
media_folder: "images/uploads" # Media files will be stored in the repo under images/uploads
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're creating a new folder for uploaded media, you'll need to know where your static site generator expects static files. You can refer to the paths outlined above in [App File Structure](#app-file-structure), and put your media folder in the same location where you put the `admin` folder.
|
If you're creating a new folder for uploaded media, you'll need to know where your static site generator expects static files. You can refer to the paths outlined above in [App File Structure](#app-file-structure), and put your media folder in the same location where you put the `admin` folder.
|
||||||
@ -112,8 +112,8 @@ Note that the`media_folder` file path is relative to the project root, so the ex
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# These lines should *not* be indented
|
# These lines should *not* be indented
|
||||||
media_folder: 'static/images/uploads' # Media files will be stored in the repo under static/images/uploads
|
media_folder: "static/images/uploads" # Media files will be stored in the repo under static/images/uploads
|
||||||
public_folder: '/images/uploads' # The src attribute for uploaded media will begin with /images/uploads
|
public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads
|
||||||
```
|
```
|
||||||
|
|
||||||
The configuration above adds a new setting, `public_folder`. While `media_folder` specifies where uploaded files will be saved in the repo, `public_folder` indicates where they can be found in the published site. This path is used in image `src` attributes and is relative to the file where it's called. For this reason, we usually start the path at the site root, using the opening `/`.
|
The configuration above adds a new setting, `public_folder`. While `media_folder` specifies where uploaded files will be saved in the repo, `public_folder` indicates where they can be found in the published site. This path is used in image `src` attributes and is relative to the file where it's called. For this reason, we usually start the path at the site root, using the opening `/`.
|
||||||
@ -127,12 +127,14 @@ Collections define the structure for the different content types on your static
|
|||||||
Let's say your site has a blog, with the posts stored in `_posts/blog`, and files saved in a date-title format, like `1999-12-31-lets-party.md`. Each post begins with settings in yaml-formatted front matter, like so:
|
Let's say your site has a blog, with the posts stored in `_posts/blog`, and files saved in a date-title format, like `1999-12-31-lets-party.md`. Each post begins with settings in yaml-formatted front matter, like so:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
---
|
||||||
layout: blog
|
layout: blog
|
||||||
title: "Let's Party"
|
title: "Let's Party"
|
||||||
date: 1999-12-31 11:59:59 -0800
|
date: 1999-12-31 11:59:59 -0800
|
||||||
thumbnail: '/images/prince.jpg'
|
thumbnail: "/images/prince.jpg"
|
||||||
rating: 5
|
rating: 5
|
||||||
...
|
---
|
||||||
|
|
||||||
This is the post body, where I write about our last chance to party before the Y2K bug destroys us all.
|
This is the post body, where I write about our last chance to party before the Y2K bug destroys us all.
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -140,18 +142,18 @@ Given this example, our `collections` settings would look like this in your Netl
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
collections:
|
collections:
|
||||||
- name: '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
|
label: "Blog" # Used in the UI
|
||||||
folder: '_posts/blog' # The path to the folder where the documents are stored
|
folder: "_posts/blog" # The path to the folder where the documents are stored
|
||||||
create: true # Allow users to create new documents in this collection
|
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
|
slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
|
||||||
fields: # The fields for each document, usually in front matter
|
fields: # The fields for each document, usually in front matter
|
||||||
- { label: 'Layout', name: 'layout', widget: 'hidden', default: 'blog' }
|
- {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
|
||||||
- { label: 'Title', name: 'title', widget: 'string' }
|
- {label: "Title", name: "title", widget: "string"}
|
||||||
- { label: 'Publish Date', name: 'date', widget: 'datetime' }
|
- {label: "Publish Date", name: "date", widget: "datetime"}
|
||||||
- { label: 'Featured Image', name: 'thumbnail', widget: 'image' }
|
- {label: "Featured Image", name: "thumbnail", widget: "image"}
|
||||||
- { label: 'Rating (scale of 1-5)', name: 'rating', widget: 'number' }
|
- {label: "Rating (scale of 1-5)", name: "rating", widget: "number"}
|
||||||
- { label: 'Body', name: 'body', widget: 'markdown' }
|
- {label: "Body", name: "body", widget: "markdown"}
|
||||||
```
|
```
|
||||||
|
|
||||||
Let's break that down:
|
Let's break that down:
|
||||||
@ -202,14 +204,14 @@ The entries for any collection can be filtered based on the value of a single fi
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
collections:
|
collections:
|
||||||
- name: 'posts'
|
- name: "posts"
|
||||||
label: 'Post'
|
label: "Post"
|
||||||
folder: '_posts'
|
folder: "_posts"
|
||||||
filter:
|
filter:
|
||||||
field: language
|
field: language
|
||||||
value: en
|
value: en
|
||||||
fields:
|
fields:
|
||||||
- { label: 'Language', name: 'language' }
|
- {label: "Language", name: "language"}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Authentication
|
## Authentication
|
||||||
|
@ -14,10 +14,9 @@ The structure of an entry is defined as a series of fields, each with a `name`,
|
|||||||
|
|
||||||
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.
|
||||||
|
|
||||||
Entries are loaded and persisted through a `backend` that will typically represent a `git` repository.
|
Entries are loaded and persisted through a `backend` that will typically represent a `git` repository.
|
||||||
|
|
||||||
## State shape / reducers
|
## State shape / reducers
|
||||||
|
|
||||||
**Auth:** Keeps track of the logged state and the current user.
|
**Auth:** Keeps track of the logged state and the current user.
|
||||||
|
|
||||||
**Config:** Holds the environment configuration (backend type, available collections and fields).
|
**Config:** Holds the environment configuration (backend type, available collections and fields).
|
||||||
@ -29,7 +28,6 @@ Entries are loaded and persisted through a `backend` that will typically represe
|
|||||||
**EntryDraft:** Reused for each entry that is edited or created. It holds the entry's temporary data until it's persisted on the backend.
|
**EntryDraft:** Reused for each entry that is edited or created. It holds the entry's temporary data until it's persisted on the backend.
|
||||||
|
|
||||||
## Selectors
|
## Selectors
|
||||||
|
|
||||||
Selectors are functions defined within reducers used to compute derived data from the Redux store. The available selectors are:
|
Selectors are functions defined within reducers used to compute derived data from the Redux store. The available selectors are:
|
||||||
|
|
||||||
**selectEntry:** Selects a single entry, given the collection and a slug.
|
**selectEntry:** Selects a single entry, given the collection and a slug.
|
||||||
@ -39,7 +37,6 @@ 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 (such as an image, for example), 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.
|
||||||
@ -47,28 +44,26 @@ For a file persisted online, the AssetProxy only keeps information about its URI
|
|||||||
The AssetProxy object can be used directly inside a media tag (such as `<img>`), as it will always return something that can be used by the media tag to render correctly (either the URI for the online file or a single-use blob).
|
The AssetProxy object can be used directly inside a media tag (such as `<img>`), as it will always return something that can be used by the media tag to render correctly (either the URI for the online file or a single-use blob).
|
||||||
|
|
||||||
## Components structure and Workflows
|
## Components structure and Workflows
|
||||||
|
|
||||||
Components are separated into two main categories: Container components and Presentational components.
|
Components are separated into two main categories: Container components and Presentational components.
|
||||||
|
|
||||||
### Entry Editing
|
### Entry Editing
|
||||||
|
|
||||||
For either updating an existing entry or creating a new one, the `EntryEditor` is used and the flow is the same:
|
For either updating an existing entry or creating a new one, the `EntryEditor` is used and the flow is the same:
|
||||||
|
|
||||||
- When mounted, the `EntryPage` container component dispatches the `createDraft` action, setting the `entryDraft` state to a blank state (in case of a new entry) or to a copy of the selected entry (in case of an edit).
|
* When mounted, the `EntryPage` container component dispatches the `createDraft` action, setting the `entryDraft` state to a blank state (in case of a new entry) or to a copy of the selected entry (in case of an edit).
|
||||||
- The `EntryPage` will also render widgets for each field type in the given entry.
|
* The `EntryPage` will also render widgets for each field type in the given entry.
|
||||||
- Widgets are used for editing entry fields. There are different widgets for different field types, and they are always defined in a pair containing a `control` and a `preview` component. The control component is responsible for presenting the user with the appropriate interface for manipulating the current field value, while the preview component is responsible for displaying the value with the appropriate styling.
|
* Widgets are used for editing entry fields. There are different widgets for different field types, and they are always defined in a pair containing a `control` and a `preview` component. The control component is responsible for presenting the user with the appropriate interface for manipulating the current field value, while the preview component is responsible for displaying the value with the appropriate styling.
|
||||||
|
|
||||||
#### Widget components implementation
|
#### Widget components implementation
|
||||||
|
|
||||||
The control component receives one (1) callback as a prop: `onChange`.
|
The control component receives one (1) callback as a prop: `onChange`.
|
||||||
|
|
||||||
- onChange (required): Should be called when the users changes the current value. It will ultimately end up updating the EntryDraft object in the Redux Store, thus updating the preview component.
|
* onChange (required): Should be called when the users changes the current value. It will ultimately end up updating the EntryDraft object in the Redux Store, thus updating the preview component.
|
||||||
- onAddAsset & onRemoveAsset (optionals): If the field accepts file uploads for media (images, for example), these callbacks should be invoked with a `AssetProxy` value object. `onAddAsset` will get the current media stored in the Redux state tree while `onRemoveAsset` will remove it. AssetProxy objects are stored in the `Medias` object and referenced in the `EntryDraft` object on the state tree.
|
* onAddAsset & onRemoveAsset (optionals): If the field accepts file uploads for media (images, for example), these callbacks should be invoked with a `AssetProxy` value object. `onAddAsset` will get the current media stored in the Redux state tree while `onRemoveAsset` will remove it. AssetProxy objects are stored in the `Medias` object and referenced in the `EntryDraft` object on the state tree.
|
||||||
|
|
||||||
Both control and preview widgets receive a `getAsset` selector via props. Displaying the media (or its URI) for the user should always be done via `getAsset`, as it returns an AssetProxy that can return the correct value for both medias already persisted on the server and cached media not yet uploaded.
|
Both control and preview widgets receive a `getAsset` selector via props. Displaying the media (or its URI) for the user should always be done via `getAsset`, as it returns an AssetProxy that can return the correct value for both medias already persisted on the server and cached media not yet uploaded.
|
||||||
|
|
||||||
The actual persistence of the content and medias inserted into the control component is delegated to the backend implementation. The backend will be called with the updated values and a list of assetProxy objects for each field of the entry, and should return a promise that can resolve into the persisted entry object and the list of the persisted media URIs.
|
The actual persistence of the content and medias inserted into the control component is delegated to the backend implementation. The backend will be called with the updated values and a list of assetProxy objects for each field of the entry, and should return a promise that can resolve into the persisted entry object and the list of the persisted media URIs.
|
||||||
|
|
||||||
|
|
||||||
## Editorial Workflow implementation
|
## Editorial Workflow implementation
|
||||||
|
|
||||||
Instead of adding logic to `CollectionPage` and `EntryPage`, the Editorial Workflow is implemented as Higher Order Components, adding UI and dispatching additional actions.
|
Instead of adding logic to `CollectionPage` and `EntryPage`, the Editorial Workflow is implemented as Higher Order Components, adding UI and dispatching additional actions.
|
||||||
|
@ -18,13 +18,13 @@ To use it in your own project stored on GitHub or GitLab, follow these steps:
|
|||||||
steps to get started.
|
steps to get started.
|
||||||
2. Add the following lines to your Netlify CMS `config.yml` file:
|
2. Add the following lines to your Netlify CMS `config.yml` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
backend:
|
backend:
|
||||||
name: git-gateway
|
name: git-gateway
|
||||||
accept_roles: #optional - accepts all users if left out
|
accept_roles: #optional - accepts all users if left out
|
||||||
- admin
|
- admin
|
||||||
- editor
|
- editor
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Optionally, you can assign roles to users in your Netlify dashboard, and then limit which
|
3. Optionally, you can assign roles to users in your Netlify dashboard, and then limit which
|
||||||
roles can access the CMS by defining the `accept_roles` field as shown in the example above.
|
roles can access the CMS by defining the `accept_roles` field as shown in the example above.
|
||||||
@ -50,11 +50,11 @@ To enable it:
|
|||||||
docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider).
|
docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider).
|
||||||
2. Add the following lines to your Netlify CMS `config.yml` file:
|
2. Add the following lines to your Netlify CMS `config.yml` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
backend:
|
backend:
|
||||||
name: github
|
name: github
|
||||||
repo: owner-name/repo-name # Path to your GitHub repository
|
repo: owner-name/repo-name # Path to your GitHub repository
|
||||||
```
|
```
|
||||||
|
|
||||||
If you prefer to run your own authentication server, check out the section on [external OAuth clients](#external-oauth-clients).
|
If you prefer to run your own authentication server, check out the section on [external OAuth clients](#external-oauth-clients).
|
||||||
|
|
||||||
@ -72,14 +72,14 @@ To enable it:
|
|||||||
|
|
||||||
1. Follow the [GitLab docs](https://docs.gitlab.com/ee/integration/oauth_provider.html#adding-an-application-through-the-profile) to add your Netlify CMS instance as an OAuth application. For the **Redirect URI**, enter `https://api.netlify.com/auth/done`, and check the box for `api` scope.
|
1. Follow the [GitLab docs](https://docs.gitlab.com/ee/integration/oauth_provider.html#adding-an-application-through-the-profile) to add your Netlify CMS instance as an OAuth application. For the **Redirect URI**, enter `https://api.netlify.com/auth/done`, and check the box for `api` scope.
|
||||||
2. Follow the [Netlify
|
2. Follow the [Netlify
|
||||||
docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider) to add your new GitLab Application ID and Secret to your Netlify site dashboard.
|
docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider) to add your new GitLab Application ID and Secret to your Netlify site dashboard.
|
||||||
3. In your repository, add the following lines to your Netlify CMS `config.yml` file:
|
2. In your repository, add the following lines to your Netlify CMS `config.yml` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
backend:
|
backend:
|
||||||
name: gitlab
|
name: gitlab
|
||||||
repo: owner-name/repo-name # Path to your GitLab repository
|
repo: owner-name/repo-name # Path to your GitLab repository
|
||||||
```
|
```
|
||||||
|
|
||||||
### Client-Side Implicit Grant
|
### Client-Side Implicit Grant
|
||||||
|
|
||||||
@ -88,26 +88,26 @@ With GitLab's Implicit Grant, users can authenticate with GitLab directly from t
|
|||||||
1. Follow the [GitLab docs](https://docs.gitlab.com/ee/integration/oauth_provider.html#adding-an-application-through-the-profile) to add your Netlify CMS instance as an OAuth application. For the **Redirect URI**, enter the address where you access Netlify CMS, for example, `https://www.mysite.com/admin/`. For scope, select `api`.
|
1. Follow the [GitLab docs](https://docs.gitlab.com/ee/integration/oauth_provider.html#adding-an-application-through-the-profile) to add your Netlify CMS instance as an OAuth application. For the **Redirect URI**, enter the address where you access Netlify CMS, for example, `https://www.mysite.com/admin/`. For scope, select `api`.
|
||||||
2. GitLab will give you an **Application ID**. Copy this and enter it in your Netlify CMS `config.yml` file, along with the following settings:
|
2. GitLab will give you an **Application ID**. Copy this and enter it in your Netlify CMS `config.yml` file, along with the following settings:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
backend:
|
backend:
|
||||||
name: gitlab
|
name: gitlab
|
||||||
repo: owner-name/repo-name # Path to your GitLab repository
|
repo: owner-name/repo-name # Path to your GitLab repository
|
||||||
auth_type: implicit # Required for implicit grant
|
auth_type: implicit # Required for implicit grant
|
||||||
app_id: your-app-id # Application ID from your GitLab settings
|
app_id: your-app-id # Application ID from your GitLab settings
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also use Implicit Grant with a self-hosted GitLab instance. This requires adding `api_root`, `base_url`, and `auth_endpoint` fields:
|
You can also use Implicit Grant with a self-hosted GitLab instance. This requires adding `api_root`, `base_url`, and `auth_endpoint` fields:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
backend:
|
backend:
|
||||||
name: gitlab
|
name: gitlab
|
||||||
repo: owner-name/repo-name # Path to your GitLab repository
|
repo: owner-name/repo-name # Path to your GitLab repository
|
||||||
auth_type: implicit # Required for implicit grant
|
auth_type: implicit # Required for implicit grant
|
||||||
app_id: your-app-id # Application ID from your GitLab settings
|
app_id: your-app-id # Application ID from your GitLab settings
|
||||||
api_root: https://my-hosted-gitlab-instance.com/api/v4
|
api_root: https://my-hosted-gitlab-instance.com/api/v4
|
||||||
base_url: https://my-hosted-gitlab-instance.com
|
base_url: https://my-hosted-gitlab-instance.com
|
||||||
auth_endpoint: oauth/authorize
|
auth_endpoint: oauth/authorize
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that in both cases, GitLab will also provide you with a client secret. You should _never_ store this in your repo or reveal it in the client.
|
Note that in both cases, GitLab will also provide you with a client secret. You should _never_ store this in your repo or reveal it in the client.
|
||||||
|
|
||||||
@ -121,11 +121,11 @@ To enable it:
|
|||||||
docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider).
|
docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider).
|
||||||
2. Add the following lines to your Netlify CMS `config.yml` file:
|
2. Add the following lines to your Netlify CMS `config.yml` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
backend:
|
backend:
|
||||||
name: bitbucket
|
name: bitbucket
|
||||||
repo: owner-name/repo-name # Path to your Bitbucket repository
|
repo: owner-name/repo-name # Path to your Bitbucket repository
|
||||||
```
|
```
|
||||||
|
|
||||||
## External OAuth Clients
|
## External OAuth Clients
|
||||||
|
|
||||||
@ -145,12 +145,12 @@ Check each project's documentation for instructions on how to configure it.
|
|||||||
|
|
||||||
Netlify CMS backends allow some additional fields for certain use cases. A full reference is below. Note that these are properties of the `backend` field, and should be nested under that field.
|
Netlify CMS backends allow some additional fields for certain use cases. A full reference is below. Note that these are properties of the `backend` field, and should be nested under that field.
|
||||||
|
|
||||||
| Field | Default | Description |
|
| Field | Default | Description |
|
||||||
| --------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `repo` | none | **Required** for `github`, `gitlab`, and `bitbucket` backends; ignored by `git-gateway`. Follows the pattern `[org-or-username]/[repo-name]`. |
|
| `repo` | none | **Required** for `github`, `gitlab`, and `bitbucket` backends; ignored by `git-gateway`. Follows the pattern `[org-or-username]/[repo-name]`. |
|
||||||
| `accept_roles` | none | `git-gateway` only. Limits CMS access to your defined array of user roles. Omitting this field gives access to all registered users. |
|
| `accept_roles` | none | `git-gateway` only. Limits CMS access to your defined array of user roles. Omitting this field gives access to all registered users. |
|
||||||
| `branch` | `master` | The branch where published content is stored. All CMS commits and PRs are made to this branch. |
|
| `branch` | `master` | The branch where published content is stored. All CMS commits and PRs are made to this branch. |
|
||||||
| `api_root` | `https://api.github.com` (GitHub), `https://gitlab.com/api/v4` (GitLab), or `https://api.bitbucket.org/2.0` (Bitbucket) | The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab. |
|
| `api_root` | `https://api.github.com` (GitHub), `https://gitlab.com/api/v4` (GitLab), or `https://api.bitbucket.org/2.0` (Bitbucket) | The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab. |
|
||||||
| `site_domain` | `location.hostname` (or `cms.netlify.com` when on `localhost`) | Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly. |
|
| `site_domain` | `location.hostname` (or `cms.netlify.com` when on `localhost`) | Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly. |
|
||||||
| `base_url` | `https://api.netlify.com` (GitHub, Bitbucket) or `https://gitlab.com` (GitLab) | OAuth client URL. **Required** when using an external OAuth server or self-hosted GitLab. |
|
| `base_url` | `https://api.netlify.com` (GitHub, Bitbucket) or `https://gitlab.com` (GitLab) | OAuth client URL. **Required** when using an external OAuth server or self-hosted GitLab. |
|
||||||
| `auth_endpoint` | `auth` (GitHub, Bitbucket) or `oauth/authorize` (GitLab) | Path to append to `base_url` for authentication requests. Optional. |
|
| `auth_endpoint` | `auth` (GitHub, Bitbucket) or `oauth/authorize` (GitLab) | Path to append to `base_url` for authentication requests. Optional. |
|
||||||
|
@ -9,7 +9,6 @@ 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 it's 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,
|
takes over the entire page, and is generally inflexible if you're trying to do something creative,
|
||||||
like injecting it into a shared context.
|
like injecting it into a shared context.
|
||||||
@ -19,7 +18,6 @@ as `nc-root`. If Netlify CMS finds an element with this ID during initialization
|
|||||||
within that element instead of creating it's own.
|
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.
|
||||||
@ -67,7 +65,6 @@ 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
|
||||||
@ -76,13 +73,12 @@ CMS.registerPreviewTemplate(...);
|
|||||||
* Takes advantage of the `toString` method in the return value of `css-loader`.
|
* Takes advantage of the `toString` method in the return value of `css-loader`.
|
||||||
*/
|
*/
|
||||||
import CMS from 'netlify-cms';
|
import CMS from 'netlify-cms';
|
||||||
import styles from '!css-loader!sass-loader!../main.scss';
|
import styles from '!css-loader!sass-loader!../main.scss'
|
||||||
|
|
||||||
CMS.registerPreviewStyle(styles.toString(), { raw: true });
|
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](/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.
|
||||||
|
|
||||||
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.
|
||||||
@ -95,7 +91,6 @@ backend:
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Commit Message Templates
|
## Commit Message Templates
|
||||||
|
|
||||||
You can customize the templates used by Netlify CMS to generate commit messages by setting the `commit_messages` option under `backend` in your Netlify CMS `config.yml`.
|
You can customize the templates used by Netlify CMS to generate commit messages by setting the `commit_messages` option under `backend` in your Netlify CMS `config.yml`.
|
||||||
|
|
||||||
Template tags wrapped in curly braces will be expanded to include information about the file changed by the commit. For example, `{{path}}` will include the full path to the file changed.
|
Template tags wrapped in curly braces will be expanded to include information about the file changed by the commit. For example, `{{path}}` will include the full path to the file changed.
|
||||||
@ -114,13 +109,13 @@ backend:
|
|||||||
|
|
||||||
Netlify CMS generates the following commit types:
|
Netlify CMS generates the following commit types:
|
||||||
|
|
||||||
| Commit type | When is it triggered? | Available template tags |
|
Commit type | When is it triggered? | Available template tags
|
||||||
| ------------- | ---------------------------- | ---------------------------- |
|
--------------|------------------------------|-----------------------------
|
||||||
| `create` | A new entry is created | `slug`, `path`, `collection` |
|
`create` | A new entry is created | `slug`, `path`, `collection`
|
||||||
| `update` | An existing entry is changed | `slug`, `path`, `collection` |
|
`update` | An existing entry is changed | `slug`, `path`, `collection`
|
||||||
| `delete` | An exising entry is deleted | `slug`, `path`, `collection` |
|
`delete` | An exising entry is deleted | `slug`, `path`, `collection`
|
||||||
| `uploadMedia` | A media file is uploaded | `path` |
|
`uploadMedia` | A media file is uploaded | `path`
|
||||||
| `deleteMedia` | A media file is deleted | `path` |
|
`deleteMedia` | A media file is deleted | `path`
|
||||||
|
|
||||||
Template tags produce the following output:
|
Template tags produce the following output:
|
||||||
|
|
||||||
|
@ -20,15 +20,15 @@ Example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
collections:
|
collections:
|
||||||
- label: 'Blog'
|
- label: "Blog"
|
||||||
name: 'blog'
|
name: "blog"
|
||||||
folder: '_posts/blog'
|
folder: "_posts/blog"
|
||||||
create: true
|
create: true
|
||||||
fields:
|
fields:
|
||||||
- { label: 'Title', name: 'title', widget: 'string' }
|
- {label: "Title", name: "title", widget: "string"}
|
||||||
- { label: 'Publish Date', name: 'date', widget: 'datetime' }
|
- {label: "Publish Date", name: "date", widget: "datetime"}
|
||||||
- { label: 'Featured Image', name: 'thumbnail', widget: 'image' }
|
- {label: "Featured Image", name: "thumbnail", widget: "image"}
|
||||||
- { label: 'Body', name: 'body', widget: 'markdown' }
|
- {label: "Body", name: "body", widget: "markdown"}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Filtered folder collections
|
### Filtered folder collections
|
||||||
@ -37,29 +37,29 @@ The entries for any folder collection can be filtered based on the value of a si
|
|||||||
|
|
||||||
The `filter` option requires two fields:
|
The `filter` option requires two fields:
|
||||||
|
|
||||||
- `field`: the name of the collection field to filter on
|
* `field`: the name of the collection field to filter on
|
||||||
- `value`: the desired field value
|
* `value`: the desired field value
|
||||||
|
|
||||||
The example below creates two collections in the same folder, filtered by the `language` field. The first collection includes posts with `language: en`, and the second, with `language: es`.
|
The example below creates two collections in the same folder, filtered by the `language` field. The first collection includes posts with `language: en`, and the second, with `language: es`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
collections:
|
collections:
|
||||||
- label: 'Blog in English'
|
- label: "Blog in English"
|
||||||
name: 'english_posts'
|
name: "english_posts"
|
||||||
folder: '_posts'
|
folder: "_posts"
|
||||||
filter: { field: 'language', value: 'en' }
|
filter: {field: "language", value: "en"}
|
||||||
fields:
|
fields:
|
||||||
- { label: 'Language', name: 'language', widget: 'select', options: ['en', 'es'] }
|
- {label: "Language", name: "language", widget: "select", options: ["en", "es"]}
|
||||||
- { label: 'Title', name: 'title', widget: 'string' }
|
- {label: "Title", name: "title", widget: "string"}
|
||||||
- { label: 'Content', name: 'body', widget: 'markdown' }
|
- {label: "Content", name: "body", widget: "markdown"}
|
||||||
- label: 'Blog en Español'
|
- label: "Blog en Español"
|
||||||
name: 'spanish_posts'
|
name: "spanish_posts"
|
||||||
folder: '_posts'
|
folder: "_posts"
|
||||||
filter: { field: 'language', value: 'es' }
|
filter: {field: "language", value: "es"}
|
||||||
fields:
|
fields:
|
||||||
- { label: 'Lenguaje', name: 'language', widget: 'select', options: ['en', 'es'] }
|
- {label: "Lenguaje", name: "language", widget: "select", options: ["en", "es"]}
|
||||||
- { label: 'Titulo', name: 'title', widget: 'string' }
|
- {label: "Titulo", name: "title", widget: "string"}
|
||||||
- { label: 'Contenido', name: 'body', widget: 'markdown' }
|
- {label: "Contenido", name: "body", widget: "markdown"}
|
||||||
```
|
```
|
||||||
|
|
||||||
## File collections
|
## File collections
|
||||||
@ -74,32 +74,32 @@ Example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
collections:
|
collections:
|
||||||
- label: 'Pages'
|
- label: "Pages"
|
||||||
name: 'pages'
|
name: "pages"
|
||||||
files:
|
files:
|
||||||
- label: 'About Page'
|
- label: "About Page"
|
||||||
name: 'about'
|
name: "about"
|
||||||
file: 'site/content/about.yml'
|
file: "site/content/about.yml"
|
||||||
fields:
|
fields:
|
||||||
- { label: Title, name: title, widget: string }
|
- {label: Title, name: title, widget: string}
|
||||||
- { label: Intro, name: intro, widget: markdown }
|
- {label: Intro, name: intro, widget: markdown}
|
||||||
- label: Team
|
- label: Team
|
||||||
name: team
|
name: team
|
||||||
widget: list
|
widget: list
|
||||||
fields:
|
fields:
|
||||||
- { label: Name, name: name, widget: string }
|
- {label: Name, name: name, widget: string}
|
||||||
- { label: Position, name: position, widget: string }
|
- {label: Position, name: position, widget: string}
|
||||||
- { label: Photo, name: photo, widget: image }
|
- {label: Photo, name: photo, widget: image}
|
||||||
- label: 'Locations Page'
|
- label: "Locations Page"
|
||||||
name: 'locations'
|
name: "locations"
|
||||||
file: 'site/content/locations.yml'
|
file: "site/content/locations.yml"
|
||||||
fields:
|
fields:
|
||||||
- { label: Title, name: title, widget: string }
|
- {label: Title, name: title, widget: string}
|
||||||
- { label: Intro, name: intro, widget: markdown }
|
- {label: Intro, name: intro, widget: markdown}
|
||||||
- label: Locations
|
- label: Locations
|
||||||
name: locations
|
name: locations
|
||||||
widget: list
|
widget: list
|
||||||
fields:
|
fields:
|
||||||
- { label: Name, name: name, widget: string }
|
- {label: Name, name: name, widget: string}
|
||||||
- { label: Address, name: address, widget: string }
|
- {label: Address, name: address, widget: string}
|
||||||
```
|
```
|
||||||
|
@ -18,9 +18,10 @@ To see working configuration examples, you can [start from a template](https://w
|
|||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
|
||||||
## Backend
|
## Backend
|
||||||
|
|
||||||
_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](https://www.netlifycms.org/docs/authentication-backends).
|
||||||
|
|
||||||
@ -42,15 +43,16 @@ publish_mode: editorial_workflow
|
|||||||
|
|
||||||
From a technical perspective, the workflow translates editor UI actions into common Git commands:
|
From a technical perspective, the workflow translates editor UI actions into common Git commands:
|
||||||
|
|
||||||
| Actions in Netlify UI ... | Perform these Git actions |
|
Actions in Netlify UI ... | Perform these Git actions
|
||||||
| ------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
--- | ---
|
||||||
| Save draft | Commits to a new branch (named according to the pattern `cms/collectionName-entrySlug`), and opens a pull request |
|
Save draft | Commits to a new branch (named according to the pattern `cms/collectionName-entrySlug`), and opens a pull request
|
||||||
| Edit draft | Pushes another commit to the draft branch/pull request |
|
Edit draft | Pushes another commit to the draft branch/pull request
|
||||||
| Approve and publish draft | Merges pull request and deletes branch |
|
Approve and publish draft | Merges pull request and deletes branch
|
||||||
|
|
||||||
|
|
||||||
## Media and Public Folders
|
## Media and Public Folders
|
||||||
|
|
||||||
_This setting is required._
|
*This setting is required.*
|
||||||
|
|
||||||
Netlify CMS users can upload files to your repository using the Media Gallery. The following settings specify where these files are saved, and where they can be accessed on your built site.
|
Netlify CMS users can upload files to your repository using the Media Gallery. The following settings specify where these files are saved, and where they can be accessed on your built site.
|
||||||
|
|
||||||
@ -61,9 +63,9 @@ Netlify CMS users can upload files to your repository using the Media Gallery. T
|
|||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
```yaml
|
``` yaml
|
||||||
media_folder: 'static/images/uploads'
|
media_folder: "static/images/uploads"
|
||||||
public_folder: '/images/uploads'
|
public_folder: "/images/uploads"
|
||||||
```
|
```
|
||||||
|
|
||||||
Based on the settings above, if a user used an image widget field called `avatar` to upload and select an image called `philosoraptor.png`, the image would be saved to the repository at `/static/images/uploads/philosoraptor.png`, and the `avatar` field for the file would be set to `/images/uploads/philosoraptor.png`.
|
Based on the settings above, if a user used an image widget field called `avatar` to upload and select an image called `philosoraptor.png`, the image would be saved to the repository at `/static/images/uploads/philosoraptor.png`, and the `avatar` field for the file would be set to `/images/uploads/philosoraptor.png`.
|
||||||
@ -91,15 +93,15 @@ The `slug` option allows you to change how filenames for entries are created and
|
|||||||
|
|
||||||
**Example**
|
**Example**
|
||||||
|
|
||||||
```yaml
|
``` yaml
|
||||||
slug:
|
slug:
|
||||||
encoding: 'ascii'
|
encoding: "ascii"
|
||||||
clean_accents: true
|
clean_accents: true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Collections
|
## Collections
|
||||||
|
|
||||||
_This setting is required._
|
*This setting is required.*
|
||||||
|
|
||||||
The `collections` setting is the heart of your Netlify CMS configuration, as it determines how content types and editor fields in the UI generate files and content in your repository. Each collection you configure displays in the left sidebar of the Content page of the editor UI, in the order they are entered into your Netlify CMS `config.yml` file.
|
The `collections` setting is the heart of your Netlify CMS configuration, as it determines how content types and editor fields in the UI generate files and content in your repository. Each collection you configure displays in the left sidebar of the Content page of the editor UI, in the order they are entered into your Netlify CMS `config.yml` file.
|
||||||
|
|
||||||
@ -135,12 +137,13 @@ You may also specify a custom `extension` not included in the list above, as lon
|
|||||||
- `toml`: parses and saves files as TOML-formatted data files; saves with `toml` extension by default
|
- `toml`: parses and saves files as TOML-formatted data files; saves with `toml` extension by default
|
||||||
- `json`: parses and saves files as JSON-formatted data files; saves with `json` extension by default
|
- `json`: parses and saves files as JSON-formatted data files; saves with `json` extension by default
|
||||||
- `frontmatter`: parses files and saves files with data frontmatter followed by an unparsed body text (edited using a `body` field); saves with `md` extension by default; default for collections that can't be inferred. Collections with `frontmatter` format (either inferred or explicitly set) can parse files with frontmatter in YAML, TOML, or JSON format. However, they will be saved with YAML frontmatter.
|
- `frontmatter`: parses files and saves files with data frontmatter followed by an unparsed body text (edited using a `body` field); saves with `md` extension by default; default for collections that can't be inferred. Collections with `frontmatter` format (either inferred or explicitly set) can parse files with frontmatter in YAML, TOML, or JSON format. However, they will be saved with YAML frontmatter.
|
||||||
- `yaml-frontmatter`: same as the `frontmatter` format above, except frontmatter will be both parsed and saved only as YAML, followed by unparsed body text. The default delimiter for this option is `---`.
|
- `yaml-frontmatter`: same as the `frontmatter` format above, except frontmatter will be both parsed and saved only as YAML, followed by unparsed body text. The default delimiter for this option is `---`.
|
||||||
- `toml-frontmatter`: same as the `frontmatter` format above, except frontmatter will be both parsed and saved only as TOML, followed by unparsed body text. The default delimiter for this option is `+++`.
|
- `toml-frontmatter`: same as the `frontmatter` format above, except frontmatter will be both parsed and saved only as TOML, followed by unparsed body text. The default delimiter for this option is `+++`.
|
||||||
- `json-frontmatter`: same as the `frontmatter` format above, except frontmatter will be both parsed and saved as JSON, followed by unparsed body text. The default delimiter for this option is `{` `}`.
|
- `json-frontmatter`: same as the `frontmatter` format above, except frontmatter will be both parsed and saved as JSON, followed by unparsed body text. The default delimiter for this option is `{` `}`.
|
||||||
|
|
||||||
`frontmatter_delimiter`: if you have an explicit frontmatter format declared, this option allows you to specify a custom delimiter like `~~~`. If you need different beginning and ending delimiters, you can use an array like `["(", ")"]`.
|
`frontmatter_delimiter`: if you have an explicit frontmatter format declared, this option allows you to specify a custom delimiter like `~~~`. If you need different beginning and ending delimiters, you can use an array like `["(", ")"]`.
|
||||||
|
|
||||||
|
|
||||||
### `slug`
|
### `slug`
|
||||||
|
|
||||||
For folder collections where users can create new items, the `slug` option specifies a template for generating new filenames based on a file's creation date and `title` field. (This means that all collections with `create: true` must have a `title` field.)
|
For folder collections where users can create new items, the `slug` option specifies a template for generating new filenames based on a file's creation date and `title` field. (This means that all collections with `create: true` must have a `title` field.)
|
||||||
@ -158,7 +161,7 @@ For folder collections where users can create new items, the `slug` option speci
|
|||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
slug: '{{year}}-{{month}}-{{day}}_{{slug}}'
|
slug: "{{year}}-{{month}}-{{day}}_{{slug}}"
|
||||||
```
|
```
|
||||||
|
|
||||||
### `fields`
|
### `fields`
|
||||||
@ -180,13 +183,13 @@ In files with frontmatter, one field should be named `body`. This special field
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
fields:
|
fields:
|
||||||
- label: 'Title'
|
- label: "Title"
|
||||||
name: 'title'
|
name: "title"
|
||||||
widget: 'string'
|
widget: "string"
|
||||||
pattern: ['.{20,}', 'Must have at least 20 characters']
|
pattern: ['.{20,}', "Must have at least 20 characters"]
|
||||||
- { label: 'Layout', name: 'layout', widget: 'hidden', default: 'blog' }
|
- {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
|
||||||
- { label: 'Featured Image', name: 'thumbnail', widget: 'image', required: false }
|
- {label: "Featured Image", name: "thumbnail", widget: "image", required: false}
|
||||||
- { label: 'Body', name: 'body', widget: 'markdown' }
|
- {label: "Body", name: "body", widget: "markdown"}
|
||||||
```
|
```
|
||||||
|
|
||||||
### `editor`
|
### `editor`
|
||||||
@ -198,6 +201,6 @@ This setting changes options for the editor view of the collection. It has one o
|
|||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
editor:
|
editor:
|
||||||
preview: false
|
preview: false
|
||||||
```
|
```
|
||||||
|
@ -8,8 +8,8 @@ We're hoping that Netlify CMS will do for the [JAMstack](https://www.jamstack.or
|
|||||||
|
|
||||||
While we work on building this page (and you can help!), here are some links with more information about getting involved:
|
While we work on building this page (and you can help!), here are some links with more information about getting involved:
|
||||||
|
|
||||||
- [Setup instructions and Contribution Guidelines](https://github.com/netlify/netlify-cms/blob/master/CONTRIBUTING.md)
|
* [Setup instructions and Contribution Guidelines](https://github.com/netlify/netlify-cms/blob/master/CONTRIBUTING.md)
|
||||||
- [Join us on Gitter](https://gitter.im/netlify/NetlifyCMS)
|
* [Join us on Gitter](https://gitter.im/netlify/NetlifyCMS)
|
||||||
- [Code of Conduct](https://github.com/netlify/netlify-cms/blob/master/CODE_OF_CONDUCT.md)
|
* [Code of Conduct](https://github.com/netlify/netlify-cms/blob/master/CODE_OF_CONDUCT.md)
|
||||||
- [Project Milestones](https://github.com/netlify/netlify-cms/milestones)
|
* [Project Milestones](https://github.com/netlify/netlify-cms/milestones)
|
||||||
- [Good First Issues](https://github.com/netlify/netlify-cms/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22+-label%3Aclaimed)
|
* [Good First Issues](https://github.com/netlify/netlify-cms/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22+-label%3Aclaimed)
|
||||||
|
@ -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:** lets you register a custom widget.
|
||||||
- **registerEditorComponent:** lets you add a block component to the Markdown editor.
|
* **registerEditorComponent:** lets you add a block component to the Markdown editor.
|
||||||
|
|
||||||
### Writing React Components inline
|
### Writing React Components inline
|
||||||
|
|
||||||
@ -30,17 +30,17 @@ CMS.registerWidget(name, control, [preview]);
|
|||||||
|
|
||||||
**Params:**
|
**Params:**
|
||||||
|
|
||||||
| Param | Type | Description |
|
| Param | Type | Description |
|
||||||
| ----------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ----------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `name` | `string` | Widget name, allows this widget to be used via the field `widget` property in config |
|
| `name` | `string` | Widget name, allows this widget to be used via the field `widget` property in config |
|
||||||
| `control` | `React.Component` or `string` | <ul><li>React component that renders the control, receives the following props: <ul><li>**value:** Current field value</li><li>**onChange:** Callback function to update the field value</li></ul></li><li>Name of a registered widget whose control should be used (includes built in widgets).</li></ul> |
|
| `control` | `React.Component` or `string`| <ul><li>React component that renders the control, receives the following props: <ul><li>**value:** Current field value</li><li>**onChange:** Callback function to update the field value</li></ul></li><li>Name of a registered widget whose control should be used (includes built in widgets).</li></ul> |
|
||||||
| [`preview`] | `React.Component`, optional | Renders the widget preview, receives the following props: <ul><li>**value:** Current preview value</li><li>**field:** Immutable map of current field configuration</li><li>**metadata:** Immutable map of any available metadata for the current field</li><li>**getAsset:** Function for retrieving an asset url for image/file fields</li><li>**entry:** Immutable Map of all entry data</li><li>**fieldsMetaData:** Immutable map of metadata from all fields.</li></ul> |
|
| [`preview`] | `React.Component`, optional | Renders the widget preview, receives the following props: <ul><li>**value:** Current preview value</li><li>**field:** Immutable map of current field configuration</li><li>**metadata:** Immutable map of any available metadata for the current field</li><li>**getAsset:** Function for retrieving an asset url for image/file fields</li><li>**entry:** Immutable Map of all entry data</li><li>**fieldsMetaData:** Immutable map of metadata from all fields.</li></ul> |
|
||||||
|
|
||||||
- **field:** The field type that this widget will be used for.
|
* **field:** The field type that this widget will be used for.
|
||||||
- **control:** A React component that renders the editing interface for this field. Two props will be passed:
|
* **control:** A React component that renders the editing interface for this field. Two props will be passed:
|
||||||
- **value:** The current value for this field.
|
* **value:** The current value for this field.
|
||||||
- **onChange:** Callback function to update the field value.
|
* **onChange:** Callback function to update the field value.
|
||||||
- **preview (optional):** A React component that renders the preview of how the content will look. A `value` prop will be passed to this component.
|
* **preview (optional):** A React component that renders the preview of how the content will look. A `value` prop will be passed to this component.
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
@ -77,12 +77,12 @@ CMS.registerWidget('categories', CategoriesControl, CategoriesPreview);
|
|||||||
Register a block level component for the Markdown editor:
|
Register a block level component for the Markdown editor:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
CMS.registerEditorComponent(definition);
|
CMS.registerEditorComponent(definition)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Params**
|
**Params**
|
||||||
|
|
||||||
- **definition:** The component definition; must specify: id, label, fields, patterns, fromBlock, toBlock, toPreview
|
* **definition:** The component definition; must specify: id, label, fields, patterns, fromBlock, toBlock, toPreview
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
@ -133,38 +133,38 @@ With custom widgets, the widget control can also optionally implement an `isVali
|
|||||||
No errors:
|
No errors:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
isValid = () => {
|
isValid = () => {
|
||||||
// Do internal validation
|
// Do internal validation
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Existing error:
|
Existing error:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
isValid = () => {
|
isValid = () => {
|
||||||
// Do internal validation
|
// Do internal validation
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
**Object with `error` (useful for returning custom error messages)**
|
**Object with `error` (useful for returning custom error messages)**
|
||||||
Existing error:
|
Existing error:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
isValid = () => {
|
isValid = () => {
|
||||||
// Do internal validation
|
// Do internal validation
|
||||||
return { error: 'Your error message.' };
|
return { error: 'Your error message.' };
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
**Promise**
|
**Promise**
|
||||||
You can also return a promise from `isValid`. While the promise is pending, the widget will be marked as "in error". When the promise resolves, the error is automatically cleared.
|
You can also return a promise from `isValid`. While the promise is pending, the widget will be marked as "in error". When the promise resolves, the error is automatically cleared.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
isValid = () => {
|
isValid = () => {
|
||||||
return this.existingPromise;
|
return this.existingPromise;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
||||||
|
@ -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 available customization methods are:
|
The NetlifyCMS exposes a `window.CMS` global object that you can use to register custom widgets, previews and editor plugins. The available customization methods are:
|
||||||
|
|
||||||
- **registerPreviewStyle:** Register a custom stylesheet to use on the preview pane.
|
* **registerPreviewStyle:** Register a custom stylesheet to use on the preview pane.
|
||||||
- **registerPreviewTemplate:** Registers a template for a collection.
|
* **registerPreviewTemplate:** Registers a template for a collection.
|
||||||
|
|
||||||
Explore the [NetlifyCMS GitHub example](https://github.com/netlify/netlify-cms/blob/9ced3f16c8bcc3d1a36773b126842d023c589eaf/example/index.html#L90-L91), a working example you can review on GitHub.
|
Explore the [NetlifyCMS GitHub example](https://github.com/netlify/netlify-cms/blob/9ced3f16c8bcc3d1a36773b126842d023c589eaf/example/index.html#L90-L91), a working example you can review on GitHub.
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ CMS.registerPreviewStyle(file);
|
|||||||
|
|
||||||
**Params:**
|
**Params:**
|
||||||
|
|
||||||
- **file:** css file path
|
* **file:** css file path
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
@ -60,13 +60,12 @@ Registers a template for a collection.
|
|||||||
|
|
||||||
**Params:**
|
**Params:**
|
||||||
|
|
||||||
- collection: The name of the collection which this preview component will be used for.
|
* collection: The name of the collection which this preview component will be used for.
|
||||||
- react_component: A React component that renders the collection data. Four props will be passed to your component during render:
|
* react_component: A React component that renders the collection data. Four props will be passed to your component during render:
|
||||||
|
* entry: Immutable collection containing the entry data.
|
||||||
- entry: Immutable collection containing the entry data.
|
* widgetFor: Returns the appropriate widget preview component for a given field.
|
||||||
- widgetFor: Returns the appropriate widget preview component for a given field.
|
* [widgetsFor](#lists-and-objects): Returns an array of objects with widgets and associated field data. For use with list and object type entries.
|
||||||
- [widgetsFor](#lists-and-objects): Returns an array of objects with widgets and associated field data. For use with list and object type entries.
|
* getAsset: Returns the correct filePath or in-memory preview for uploaded images.
|
||||||
- getAsset: Returns the correct filePath or in-memory preview for uploaded images.
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
```html
|
```html
|
||||||
@ -88,9 +87,7 @@ Registers a template for a collection.
|
|||||||
CMS.registerPreviewTemplate("posts", PostPreview);
|
CMS.registerPreviewTemplate("posts", PostPreview);
|
||||||
</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
|
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
|
nested fields is facilitated through the `widgetsFor` function, which is passed to the preview
|
||||||
@ -99,7 +96,6 @@ Registers a template for a collection.
|
|||||||
Immutable.js. If some of the methods that we use are unfamiliar, such as `getIn`, check out
|
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.
|
[their docs](https://facebook.github.io/immutable-js/docs/#/) to get a better understanding.
|
||||||
**List Example:**
|
**List Example:**
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script>
|
<script>
|
||||||
var AuthorsPreview = createClass({
|
var AuthorsPreview = createClass({
|
||||||
@ -141,9 +137,7 @@ Registers a template for a collection.
|
|||||||
CMS.registerPreviewTemplate("authors", AuthorsPreview);
|
CMS.registerPreviewTemplate("authors", AuthorsPreview);
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Object Example:**
|
**Object Example:**
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script>
|
<script>
|
||||||
var GeneralPreview = createClass({
|
var GeneralPreview = createClass({
|
||||||
@ -176,24 +170,18 @@ Registers a template for a collection.
|
|||||||
CMS.registerPreviewTemplate("general", GeneralPreview);
|
CMS.registerPreviewTemplate("general", GeneralPreview);
|
||||||
</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() {
|
||||||
const { entry, fieldsMetaData } = this.props;
|
const {entry, fieldsMetaData} = this.props;
|
||||||
const author = fieldsMetaData.getIn(['authors', data.author]);
|
const author = fieldsMetaData.getIn(['authors', data.author]);
|
||||||
|
|
||||||
return (
|
return <article><h2>{ entry.getIn(['data', 'title']) }</h2>
|
||||||
<article>
|
{author &&<AuthorBio author={author.toJS()}/>}
|
||||||
<h2>{entry.getIn(['data', 'title'])}</h2>
|
</article>
|
||||||
{author && <AuthorBio author={author.toJS()} />}
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -6,10 +6,10 @@ group: start
|
|||||||
|
|
||||||
Do you have a great, open source example? Submit a pull request to this page!
|
Do you have a great, open source example? Submit a pull request to this page!
|
||||||
|
|
||||||
| Example | Tools | Type | Source | More info |
|
Example | Tools | Type | Source | More info |
|
||||||
| ------------------------------------------------------ | ----------- | ---- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
--- | --- | --- | --- | ---
|
||||||
| [This Developing Journey](https://briandouglas.me) | middleman | blog | [bdougie/blog](https://github.com/bdougie/blog) | [blog post](https://www.netlify.com/blog/2017/04/20/creating-a-blog-with-middleman-and-netlify-cms/) |
|
[This Developing Journey](https://briandouglas.me) | middleman | blog | [bdougie/blog](https://github.com/bdougie/blog) | [blog post](https://www.netlify.com/blog/2017/04/20/creating-a-blog-with-middleman-and-netlify-cms/)
|
||||||
| [JAMstack Recipes](https://jamstack-cms.netlify.com) | Hugo, Azure | demo | [hlaueriksson/jamstack-cms](https://github.com/hlaueriksson/jamstack-cms) | [blog post](http://conductofcode.io/post/managing-content-for-a-jamstack-site-with-netlify-cms/) |
|
[JAMstack Recipes](https://jamstack-cms.netlify.com) | Hugo, Azure | demo | [hlaueriksson/jamstack-cms](https://github.com/hlaueriksson/jamstack-cms) | [blog post](http://conductofcode.io/post/managing-content-for-a-jamstack-site-with-netlify-cms/)
|
||||||
| [The Ragasirtahk Blog](https://www.ragasirtahk.tk/) | Hugo | blog | [ragasirtahk/the-ragasirtahk-blog](https://github.com/ragasirtahk/the-ragasirtahk-blog) | [blog post](https://www.ragasirtahk.tk/2018/01/setting-up-netlify-cms-on-hugo/) |
|
[The Ragasirtahk Blog](https://www.ragasirtahk.tk/) | Hugo | blog | [ragasirtahk/the-ragasirtahk-blog](https://github.com/ragasirtahk/the-ragasirtahk-blog) | [blog post](https://www.ragasirtahk.tk/2018/01/setting-up-netlify-cms-on-hugo/)
|
||||||
| [Forest Garden Wales](https://www.forestgarden.wales/) | Hugo | blog | [forestgardenwales/forestgarden.wales](https://github.com/forestgardenwales/forestgarden.wales) | [blog post](https://www.forestgarden.wales/blog/now-using-netlify-cms/) |
|
[Forest Garden Wales](https://www.forestgarden.wales/) | Hugo | blog | [forestgardenwales/forestgarden.wales](https://github.com/forestgardenwales/forestgarden.wales) | [blog post](https://www.forestgarden.wales/blog/now-using-netlify-cms/)
|
||||||
| [Cup of Data](https://www.cupofdata.com/blog) | Gatsby | blog | [cupofdata/cupofdata.com](https://github.com/cupofdata/cupofdata.com) | - |
|
[Cup of Data](https://www.cupofdata.com/blog) | Gatsby | blog | [cupofdata/cupofdata.com](https://github.com/cupofdata/cupofdata.com) | -
|
||||||
|
@ -8,12 +8,13 @@ Netlify CMS is an open source content management system for your Git workflow th
|
|||||||
|
|
||||||
At its core, Netlify CMS is an open-source React app that acts as a wrapper for the Git workflow, using the GitHub, GitLab, or Bitbucket API. This provides many advantages, including:
|
At its core, Netlify CMS is an open-source React app that acts as a wrapper for the Git workflow, using the GitHub, GitLab, or Bitbucket API. This provides many advantages, including:
|
||||||
|
|
||||||
- **Fast, web-based UI:** with rich-text editing, real-time preview, and drag-and-drop media uploads.
|
* **Fast, web-based UI:** with rich-text editing, real-time preview, and drag-and-drop media uploads.
|
||||||
- **Platform agnostic:** works with most static site generators.
|
* **Platform agnostic:** works with most static site generators.
|
||||||
- **Easy installation:** add two files to your site and hook up the backend by including in your build process or linking to our CDN.
|
* **Easy installation:** add two files to your site and hook up the backend by including in your build process or linking to our CDN.
|
||||||
- **Modern authentication:** using GitHub, GitLab, or Bitbucket and JSON web tokens.
|
* **Modern authentication:** using GitHub, GitLab, or Bitbucket and JSON web tokens.
|
||||||
- **Flexible content types:** specify an unlimited number of content types with custom fields.
|
* **Flexible content types:** specify an unlimited number of content types with custom fields.
|
||||||
- **Fully extensible:** create custom-styled previews, UI widgets, and editor plugins.
|
* **Fully extensible:** create custom-styled previews, UI widgets, and editor plugins.
|
||||||
|
|
||||||
|
|
||||||
## Find out more
|
## Find out more
|
||||||
|
|
||||||
|
@ -25,11 +25,11 @@ After clicking one of those buttons, you’ll authenticate with GitHub or GitLab
|
|||||||
|
|
||||||
1. The template deploy process will send you an invitation to your new site, sent from `no-reply@netlify.com`.
|
1. The template deploy process will send you an invitation to your new site, sent from `no-reply@netlify.com`.
|
||||||
|
|
||||||
![Sample email subject line: You've been invited to join radiologist-amanda-53841.netlify.com](https://www.netlifycms.org/img/email-subject.png?raw=true)
|
![Sample email subject line: You've been invited to join radiologist-amanda-53841.netlify.com](https://www.netlifycms.org/img/email-subject.png?raw=true)
|
||||||
|
|
||||||
2. Click the link to accept the invite, and you’ll be directed to your site, with a prompt to create a password.
|
2. Click the link to accept the invite, and you’ll be directed to your site, with a prompt to create a password.
|
||||||
|
|
||||||
!["Complete your signup" modal on the Kaldi coffee site](https://www.netlifycms.org/img/create-password.png?raw=true)
|
!["Complete your signup" modal on the Kaldi coffee site](https://www.netlifycms.org/img/create-password.png?raw=true)
|
||||||
|
|
||||||
3. Enter a password, sign in, and you’ll be directed straight to the CMS. (For future visits, you can go straight to `<yoursiteaddress.com>/admin/`.)
|
3. Enter a password, sign in, and you’ll be directed straight to the CMS. (For future visits, you can go straight to `<yoursiteaddress.com>/admin/`.)
|
||||||
|
|
||||||
|
@ -15,12 +15,11 @@ If you are using a package manager like Yarn or NPM, you will use their standard
|
|||||||
If you are using the CMS through a CDN like Unpkg, then that depends on the version tag you are using. You can find the version tag you are using in the `/admin/index.html` file of your site.
|
If you are using the CMS through a CDN like Unpkg, then that depends on the version tag you are using. You can find the version tag you are using in the `/admin/index.html` file of your site.
|
||||||
|
|
||||||
- (Recommended) If you use `^2.0.0`, the CMS will do all updates except major versions automatically.
|
- (Recommended) If you use `^2.0.0`, the CMS will do all updates except major versions automatically.
|
||||||
|
- It will upgrade to `2.0.1`, `2.1.0`, `2.1.2`.
|
||||||
- It will upgrade to `2.0.1`, `2.1.0`, `2.1.2`.
|
- It will not upgrade to `3.0.0` or higher.
|
||||||
- It will not upgrade to `3.0.0` or higher.
|
- It will not upgrade to beta versions.
|
||||||
- It will not upgrade to beta versions.
|
|
||||||
|
|
||||||
- If you use `~2.0.0`, the CMS will do only patch updates automatically.
|
- If you use `~2.0.0`, the CMS will do only patch updates automatically.
|
||||||
- It will upgrade `2.0.1`, `2.0.2`.
|
- It will upgrade `2.0.1`, `2.0.2`.
|
||||||
- It will not upgrade to `2.1.0` or higher.
|
- It will not upgrade to `2.1.0` or higher.
|
||||||
- It will not upgrade beta versions.
|
- It will not upgrade beta versions.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'Boolean'
|
label: "Boolean"
|
||||||
target: boolean
|
target: boolean
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -12,5 +12,5 @@ The boolean widget translates a toggle switch input to a true/false value.
|
|||||||
- `default`: accepts `true` or `false`; defaults to `false`
|
- `default`: accepts `true` or `false`; defaults to `false`
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- { label: 'Draft', name: 'draft', widget: 'boolean', default: true }
|
- {label: "Draft", name: "draft", widget: "boolean", default: true}
|
||||||
```
|
```
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'Date'
|
label: "Date"
|
||||||
target: date
|
target: date
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -13,9 +13,9 @@ The date widget translates a date picker input to a date string. For saving date
|
|||||||
- `format`: optional; accepts Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/); defaults to raw Date object (if supported by output format)
|
- `format`: optional; accepts Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/); defaults to raw Date object (if supported by output format)
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Birthdate'
|
- label: "Birthdate"
|
||||||
name: 'birthdate'
|
name: "birthdate"
|
||||||
widget: 'date'
|
widget: "date"
|
||||||
default: ''
|
default: ""
|
||||||
format: 'MMM Do YY'
|
format: "MMM Do YY"
|
||||||
```
|
```
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'DateTime'
|
label: "DateTime"
|
||||||
target: datetime
|
target: datetime
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -13,9 +13,9 @@ The datetime widget translates a datetime picker to a datetime string. For savin
|
|||||||
- `format`: optional; accepts Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/); defaults to raw Date object (if supported by output format)
|
- `format`: optional; accepts Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/); defaults to raw Date object (if supported by output format)
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Start time'
|
- label: "Start time"
|
||||||
name: 'start'
|
name: "start"
|
||||||
widget: 'datetime'
|
widget: "datetime"
|
||||||
default: ''
|
default: ""
|
||||||
format: 'LLL'
|
format: "LLL"
|
||||||
```
|
```
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'File'
|
label: "File"
|
||||||
target: file
|
target: file
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -12,8 +12,8 @@ The file widget allows editors to upload a file or select an existing one from t
|
|||||||
- `default`: accepts a file path string; defaults to null
|
- `default`: accepts a file path string; defaults to null
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Manual PDF'
|
- label: "Manual PDF"
|
||||||
name: 'manual_pdf'
|
name: "manual_pdf"
|
||||||
widget: 'file'
|
widget: "file"
|
||||||
default: '/uploads/general-manual.pdf'
|
default: "/uploads/general-manual.pdf"
|
||||||
```
|
```
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'Hidden'
|
label: "Hidden"
|
||||||
target: hidden
|
target: hidden
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -8,9 +8,9 @@ Hidden widgets do not display in the UI. In folder collections that allow users
|
|||||||
- **Name:** `hidden`
|
- **Name:** `hidden`
|
||||||
- **UI:** none
|
- **UI:** none
|
||||||
- **Data type:** any valid data type
|
- **Data type:** any valid data type
|
||||||
- **Options:**
|
- **Options:**
|
||||||
- `default`: accepts any valid data type; recommended for collections that allow adding new items
|
- `default`: accepts any valid data type; recommended for collections that allow adding new items
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- { label: 'Layout', name: 'layout', widget: 'hidden', default: 'blog' }
|
- {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
|
||||||
```
|
```
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'Image'
|
label: "Image"
|
||||||
target: image
|
target: image
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -12,8 +12,8 @@ The image widget allows editors to upload an image or select an existing one fro
|
|||||||
- `default`: accepts a file path string; defaults to null
|
- `default`: accepts a file path string; defaults to null
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Featured Image'
|
- label: "Featured Image"
|
||||||
name: 'thumbnail'
|
name: "thumbnail"
|
||||||
widget: 'image'
|
widget: "image"
|
||||||
default: '/uploads/chocolate-dogecoin.jpg'
|
default: "/uploads/chocolate-dogecoin.jpg"
|
||||||
```
|
```
|
||||||
|
@ -10,19 +10,19 @@ Widgets are specified as collection fields in the Netlify CMS `config.yml` file.
|
|||||||
|
|
||||||
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/packages/netlify-cms/example/config.yml) to see how each field was configured.
|
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/packages/netlify-cms/example/config.yml) to see how each field was configured.
|
||||||
|
|
||||||
|
|
||||||
## Common widget options
|
## Common widget options
|
||||||
|
|
||||||
The following options are available on all fields:
|
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`
|
||||||
- `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](https://www.netlifycms.org/docs/custom-widgets/#advanced-field-validation)
|
||||||
|
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Title'
|
- label: "Title"
|
||||||
name: 'title'
|
name: "title"
|
||||||
widget: 'string'
|
widget: "string"
|
||||||
pattern: ['.{12,}', 'Must have at least 12 characters']
|
pattern: [".{12,}", "Must have at least 12 characters"]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Default widgets
|
## Default widgets
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'List'
|
label: "List"
|
||||||
target: list
|
target: list
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -15,38 +15,38 @@ The list widget allows you to create a repeatable item in the UI which saves as
|
|||||||
- `fields`: a nested list of multiple widget fields to be included in each repeatable iteration
|
- `fields`: a nested list of multiple widget fields to be included in each repeatable iteration
|
||||||
- **Example** (`field`/`fields` not specified):
|
- **Example** (`field`/`fields` not specified):
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Tags'
|
- label: "Tags"
|
||||||
name: 'tags'
|
name: "tags"
|
||||||
widget: 'list'
|
widget: "list"
|
||||||
default: ['news']
|
default: ["news"]
|
||||||
```
|
```
|
||||||
- **Example** (`allow_add` marked `false`):
|
- **Example** (`allow_add` marked `false`):
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Tags'
|
- label: "Tags"
|
||||||
name: 'tags'
|
name: "tags"
|
||||||
widget: 'list'
|
widget: "list"
|
||||||
allow_add: false
|
allow_add: false
|
||||||
default: ['news']
|
default: ["news"]
|
||||||
```
|
```
|
||||||
- **Example** (with `field`):
|
- **Example** (with `field`):
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Gallery'
|
- label: "Gallery"
|
||||||
name: 'galleryImages'
|
name: "galleryImages"
|
||||||
widget: 'list'
|
widget: "list"
|
||||||
field:
|
field:
|
||||||
- { label: Image, name: image, widget: image }
|
- {label: Image, name: image, widget: image}
|
||||||
```
|
```
|
||||||
- **Example** (with `fields`):
|
- **Example** (with `fields`):
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Testimonials'
|
- label: "Testimonials"
|
||||||
name: 'testimonials'
|
name: "testimonials"
|
||||||
widget: 'list'
|
widget: "list"
|
||||||
fields:
|
fields:
|
||||||
- { label: Quote, name: quote, widget: string, default: 'Everything is awesome!' }
|
- {label: Quote, name: quote, widget: string, default: "Everything is awesome!"}
|
||||||
- label: Author
|
- label: Author
|
||||||
name: author
|
name: author
|
||||||
widget: object
|
widget: object
|
||||||
fields:
|
fields:
|
||||||
- { label: Name, name: name, widget: string, default: 'Emmet' }
|
- {label: Name, name: name, widget: string, default: "Emmet"}
|
||||||
- { label: Avatar, name: avatar, widget: image, default: '/img/emmet.jpg' }
|
- {label: Avatar, name: avatar, widget: image, default: "/img/emmet.jpg"}
|
||||||
```
|
```
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
label: 'Markdown'
|
label: "Markdown"
|
||||||
target: markdown
|
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 then the CMS can recognize it and save the file accordingly.
|
||||||
|
|
||||||
- **Name:** `markdown`
|
- **Name:** `markdown`
|
||||||
- **UI:** full text editor
|
- **UI:** full text editor
|
||||||
@ -15,7 +15,7 @@ _Please note:_ in case you want to use your markdown editor to fill a markdown's
|
|||||||
- `buttons`: an array of strings representing the formatting buttons to display, all buttons shown by default. Buttons include: `bold`, `italic`, `code`, `link`, `heading-one`, `heading-two`, `quote`, `code-block`, `bulleted-list`, and `numbered-list`.
|
- `buttons`: an array of strings representing the formatting buttons to display, all buttons shown by default. Buttons include: `bold`, `italic`, `code`, `link`, `heading-one`, `heading-two`, `quote`, `code-block`, `bulleted-list`, and `numbered-list`.
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- { label: 'Blog post content', name: 'body', widget: 'markdown' }
|
- {label: "Blog post content", name: "body", widget: "markdown"}
|
||||||
```
|
```
|
||||||
This would render as:
|
This would render as:
|
||||||
![Markdown widget example](/img/widgets-markdown.png)
|
![Markdown widget example](/img/widgets-markdown.png)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'Number'
|
label: "Number"
|
||||||
target: number
|
target: number
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -15,11 +15,11 @@ The number widget uses an HTML number input, saving the value as a string, integ
|
|||||||
- `max`: accepts a number for maximum value accepted; unset by default
|
- `max`: accepts a number for maximum value accepted; unset by default
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Puppy Count'
|
- label: "Puppy Count"
|
||||||
name: 'puppies'
|
name: "puppies"
|
||||||
widget: 'number'
|
widget: "number"
|
||||||
default: 2
|
default: 2
|
||||||
valueType: 'int'
|
valueType: "int"
|
||||||
min: 1
|
min: 1
|
||||||
max: 101
|
max: 101
|
||||||
```
|
```
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'Object'
|
label: "Object"
|
||||||
target: object
|
target: object
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -13,22 +13,22 @@ The object widget allows you to group multiple widgets together, nested under a
|
|||||||
- `fields`: (**required**) a nested list of widget fields to include in your widget
|
- `fields`: (**required**) a nested list of widget fields to include in your widget
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Profile'
|
- label: "Profile"
|
||||||
name: 'profile'
|
name: "profile"
|
||||||
widget: 'object'
|
widget: "object"
|
||||||
fields:
|
fields:
|
||||||
- { label: 'Public', name: 'public', widget: 'boolean', default: true }
|
- {label: "Public", name: "public", widget: "boolean", default: true}
|
||||||
- { label: 'Name', name: 'name', widget: 'string' }
|
- {label: "Name", name: "name", widget: "string"}
|
||||||
- label: 'Birthdate'
|
- label: "Birthdate"
|
||||||
name: 'birthdate'
|
name: "birthdate"
|
||||||
widget: 'date'
|
widget: "date"
|
||||||
default: ''
|
default: ""
|
||||||
format: 'MM/DD/YYYY'
|
format: "MM/DD/YYYY"
|
||||||
- label: 'Address'
|
- label: "Address"
|
||||||
name: 'address'
|
name: "address"
|
||||||
widget: 'object'
|
widget: "object"
|
||||||
fields:
|
fields:
|
||||||
- { label: 'Street Address', name: 'street', widget: 'string' }
|
- {label: "Street Address", name: "street", widget: "string"}
|
||||||
- { label: 'City', name: 'city', widget: 'string' }
|
- {label: "City", name: "city", widget: "string"}
|
||||||
- { label: 'Postal Code', name: 'post-code', widget: 'string' }
|
- {label: "Postal Code", name: "post-code", widget: "string"}
|
||||||
```
|
```
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'Relation'
|
label: "Relation"
|
||||||
target: relation
|
target: relation
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -16,12 +16,12 @@ The relation widget allows you to reference items from another collection. It pr
|
|||||||
- `valueField`: (**required**) name of the field from the referenced collection whose value will be stored for the relation
|
- `valueField`: (**required**) name of the field from the referenced collection whose value will be stored for the relation
|
||||||
- **Example** (assuming a separate "authors" collection with "name" and "twitterHandle" fields):
|
- **Example** (assuming a separate "authors" collection with "name" and "twitterHandle" fields):
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Post Author'
|
- label: "Post Author"
|
||||||
name: 'author'
|
name: "author"
|
||||||
widget: 'relation'
|
widget: "relation"
|
||||||
collection: 'authors'
|
collection: "authors"
|
||||||
searchFields: ['name', 'twitterHandle']
|
searchFields: ["name", "twitterHandle"]
|
||||||
valueField: 'name'
|
valueField: "name"
|
||||||
displayFields: ['twitterHandle', 'followerCount']
|
displayFields: ["twitterHandle", "followerCount"]
|
||||||
```
|
```
|
||||||
The generated UI input will search the authors collection by name and twitterHandle, and display each author's handle and follower count. On selection, the author name will be saved for the field.
|
The generated UI input will search the authors collection by name and twitterHandle, and display each author's handle and follower count. On selection, the author name will be saved for the field.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'Select'
|
label: "Select"
|
||||||
target: select
|
target: select
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -11,22 +11,23 @@ The select widget allows you to pick a single string value from a dropdown menu.
|
|||||||
- **Options:**
|
- **Options:**
|
||||||
- `default`: accepts a string; defaults to an empty string
|
- `default`: accepts a string; defaults to an empty string
|
||||||
- `options`: (**required**) a list of options for the dropdown menu; can be listed in two ways:
|
- `options`: (**required**) a list of options for the dropdown menu; can be listed in two ways:
|
||||||
- string values: the label displayed in the dropdown is the value saved in the file
|
- string values: the label displayed in the dropdown is the value saved in the file
|
||||||
- object with `label` and `value` fields: the label displays in the dropdown; the value is saved in the file
|
- object with `label` and `value` fields: the label displays in the dropdown; the value is saved in the file
|
||||||
- **Example** (options as strings):
|
- **Example** (options as strings):
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'Align Content'
|
- label: "Align Content"
|
||||||
name: 'align'
|
name: "align"
|
||||||
widget: 'select'
|
widget: "select"
|
||||||
options: ['left', 'center', 'right']
|
options: ["left", "center", "right"]
|
||||||
```
|
```
|
||||||
- **Example** (options as objects):
|
- **Example** (options as objects):
|
||||||
```yaml
|
```yaml
|
||||||
- label: 'City'
|
- label: "City"
|
||||||
name: 'airport-code'
|
name: "airport-code"
|
||||||
widget: 'select'
|
widget: "select"
|
||||||
options:
|
options:
|
||||||
- { label: 'Chicago', value: 'ORD' }
|
- { label: "Chicago", value: "ORD" }
|
||||||
- { label: 'Paris', value: 'CDG' }
|
- { label: "Paris", value: "CDG" }
|
||||||
- { label: 'Tokyo', value: 'HND' }
|
- { label: "Tokyo", value: "HND" }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'String'
|
label: "String"
|
||||||
target: string
|
target: string
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -12,5 +12,5 @@ The string widget translates a basic text input to a string value. For larger te
|
|||||||
- `default`: accepts a string; defaults to an empty string
|
- `default`: accepts a string; defaults to an empty string
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- { label: 'Title', name: 'title', widget: 'string' }
|
- {label: "Title", name: "title", widget: "string"}
|
||||||
```
|
```
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
label: 'Text'
|
label: "Text"
|
||||||
target: text
|
target: text
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -12,5 +12,5 @@ The text widget takes a multiline text field and saves it as a string. For short
|
|||||||
- `default`: accepts a string; defaults to an empty string
|
- `default`: accepts a string; defaults to an empty string
|
||||||
- **Example:**
|
- **Example:**
|
||||||
```yaml
|
```yaml
|
||||||
- { label: 'Description', name: 'description', widget: 'text' }
|
- {label: "Description", name: "description", widget: "text"}
|
||||||
```
|
```
|
||||||
|
@ -2,16 +2,13 @@
|
|||||||
title: Community
|
title: Community
|
||||||
|
|
||||||
headline: Be a part of building the CMS of the future.
|
headline: Be a part of building the CMS of the future.
|
||||||
subhead:
|
subhead: We’re serious about being community driven, so everyone is welcome to join the [community chat](https://gitter.im/netlify/NetlifyCMS), and to be a part of our bi-weekly planning sessions (details below).
|
||||||
We’re serious about being community driven, so everyone is welcome to join the [community chat](https://gitter.im/netlify/NetlifyCMS), and to be a part of our bi-weekly planning sessions (details below).
|
primarycta: "[Register on Eventbrite →](https://www.eventbrite.com/e/netlify-cms-planning-session-bi-weekly-tickets-35794058994)"
|
||||||
primarycta:
|
|
||||||
'[Register on Eventbrite →](https://www.eventbrite.com/e/netlify-cms-planning-session-bi-weekly-tickets-35794058994)'
|
|
||||||
|
|
||||||
upcomingevent:
|
upcomingevent:
|
||||||
hook: The next development planning session is on
|
hook: The next development planning session is on
|
||||||
|
|
||||||
howitworks:
|
howitworks: Every other week we have public development planning sessions. They're web based, last about an hour, and are geared toward contributors and those interested in contributing. Sessions currently take place every other Wednesday, 9am - 10am PT.
|
||||||
Every other week we have public development planning sessions. They're web based, last about an hour, and are geared toward contributors and those interested in contributing. Sessions currently take place every other Wednesday, 9am - 10am PT.
|
|
||||||
|
|
||||||
howtojoin: |
|
howtojoin: |
|
||||||
**On the web:**
|
**On the web:**
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
footer:
|
footer:
|
||||||
buttons:
|
buttons:
|
||||||
- name: 'Twitter'
|
- name: "Twitter"
|
||||||
url: 'https://twitter.com/netlifycms'
|
url: "https://twitter.com/netlifycms"
|
||||||
- name: 'GitHub'
|
- name: "GitHub"
|
||||||
url: 'https://github.com/netlify/netlify-cms'
|
url: "https://github.com/netlify/netlify-cms"
|
||||||
|
@ -1,52 +1,41 @@
|
|||||||
hero:
|
hero:
|
||||||
headline: 'Open source content management for your Git workflow'
|
headline: "Open source content management for your Git workflow"
|
||||||
subhead:
|
subhead: "Use Netlify CMS with any static site generator for a faster and more flexible web project"
|
||||||
'Use Netlify CMS with any static site generator for a faster and more flexible web project'
|
|
||||||
devfeatures:
|
devfeatures:
|
||||||
- feature: 'Static + content management = ♥'
|
- feature: "Static + content management = ♥"
|
||||||
description:
|
description: "Get the speed, security, and scalability of a static site, while still providing a convenient editing interface for content."
|
||||||
'Get the speed, security, and scalability of a static site, while still providing a convenient editing interface for content.'
|
- feature: "An integrated part of your Git workflow"
|
||||||
- feature: 'An integrated part of your Git workflow'
|
description: "Content is stored in your Git repository alongside your code for easier versioning, multi-channel publishing, and the option to handle content updates directly in Git."
|
||||||
description:
|
- feature: "An extensible CMS built on React"
|
||||||
'Content is stored in your Git repository alongside your code for easier versioning, multi-channel publishing, and the option to handle content updates directly in Git.'
|
description: "Netlify CMS is built as a single-page React app. Create custom-styled previews, UI widgets, and editor plugins or add backends to support different Git platform APIs."
|
||||||
- feature: 'An extensible CMS built on React'
|
|
||||||
description:
|
|
||||||
'Netlify CMS is built as a single-page React app. Create custom-styled previews, UI widgets, and editor plugins or add backends to support different Git platform APIs.'
|
|
||||||
|
|
||||||
cta:
|
cta:
|
||||||
primaryhook: 'Getting started is simple and free.'
|
primaryhook: "Getting started is simple and free."
|
||||||
primary:
|
primary: "Choose a template that’s pre-configured with a static site generator and deploys to a global CDN in one click."
|
||||||
'Choose a template that’s pre-configured with a static site generator and deploys to a global CDN in one click.'
|
button: "[Get started](/docs/start-with-a-template/)"
|
||||||
button: '[Get started](/docs/start-with-a-template/)'
|
|
||||||
|
|
||||||
editors:
|
editors:
|
||||||
hook: 'A CMS that developers and content editors can agree on'
|
hook: "A CMS that developers and content editors can agree on"
|
||||||
intro:
|
intro: "You get to implement modern front end tools to deliver a faster, safer, and more scalable site. Editors get a friendly UI and intuitive workflow that meets their content management requirements."
|
||||||
'You get to implement modern front end tools to deliver a faster, safer, and more scalable site. Editors get a friendly UI and intuitive workflow that meets their content management requirements.'
|
|
||||||
features:
|
features:
|
||||||
- feature: 'Editor-friendly user interface'
|
- feature: "Editor-friendly user interface"
|
||||||
description:
|
description: "The web-based app includes rich-text editing, real-time preview, and drag-and-drop media uploads."
|
||||||
'The web-based app includes rich-text editing, real-time preview, and drag-and-drop media uploads.'
|
imgpath: "feature-editor.svg"
|
||||||
imgpath: 'feature-editor.svg'
|
- feature: "Intuitive workflow for content teams"
|
||||||
- feature: 'Intuitive workflow for content teams'
|
description: "Writers and editors can easily manage content from draft to review to publish across any number of custom content types."
|
||||||
description:
|
imgpath: "feature-workflow.svg"
|
||||||
'Writers and editors can easily manage content from draft to review to publish across any number of custom content types.'
|
- feature: "Instant access without GitHub account"
|
||||||
imgpath: 'feature-workflow.svg'
|
description: "With [Git Gateway](/docs/authentication-backends/#git-gateway-with-netlify-identity), you can add CMS access for any team member — even if they don’t have a GitHub account. "
|
||||||
- feature: 'Instant access without GitHub account'
|
imgpath: "feature-access.svg"
|
||||||
description:
|
|
||||||
'With [Git Gateway](/docs/authentication-backends/#git-gateway-with-netlify-identity), you can add CMS access for any team member — even if they don’t have a GitHub account. '
|
|
||||||
imgpath: 'feature-access.svg'
|
|
||||||
|
|
||||||
community:
|
community:
|
||||||
hook: 'Supported by a growing community'
|
hook: "Supported by a growing community"
|
||||||
features:
|
features:
|
||||||
- feature: 'Built on the JAMstack'
|
- feature: "Built on the JAMstack"
|
||||||
description:
|
description: "Netlify CMS is based on client-side JavaScript, reusable APIs and prebuilt Markup. Compared to server-side CMS like WordPress, this means better performance, higher security, lower cost of scaling, and a better developer experience. You can learn more about the JAMstack on [jamstack.org](https://jamstack.org)."
|
||||||
'Netlify CMS is based on client-side JavaScript, reusable APIs and prebuilt Markup. Compared to server-side CMS like WordPress, this means better performance, higher security, lower cost of scaling, and a better developer experience. You can learn more about the JAMstack on [jamstack.org](https://jamstack.org).'
|
- feature: "Support when you need it"
|
||||||
- feature: 'Support when you need it'
|
description: "Get up and running with comprehensive [documentation](/docs) and templates or work through difficult problems with help from the community on [Gitter](https://gitter.im/netlify/NetlifyCMS)."
|
||||||
description:
|
- feature: "A community-driven project you can help evolve"
|
||||||
'Get up and running with comprehensive [documentation](/docs) and templates or work through difficult problems with help from the community on [Gitter](https://gitter.im/netlify/NetlifyCMS).'
|
description: "Netlify CMS is built by a community of more than 100 contributors — and you can help. Join our [bi-weekly planning sessions](/community) or read the [contributing guide](/docs/contributor-guide) to join in."
|
||||||
- feature: 'A community-driven project you can help evolve'
|
contributors: "Made possible by awesome contributors"
|
||||||
description:
|
|
||||||
'Netlify CMS is built by a community of more than 100 contributors — and you can help. Join our [bi-weekly planning sessions](/community) or read the [contributing guide](/docs/contributor-guide) to join in.'
|
|
||||||
contributors: 'Made possible by awesome contributors'
|
|
||||||
|
@ -1,29 +1,28 @@
|
|||||||
notifications:
|
notifications:
|
||||||
- loud: true
|
- loud: true
|
||||||
message: >-
|
message: >-
|
||||||
Register to join us online for our next community dev meeting, every other
|
Register to join us online for our next community dev meeting, every other
|
||||||
Wednesday at 9am-10am PT!
|
Wednesday at 9am-10am PT!
|
||||||
published: false
|
published: false
|
||||||
title: Netlify CMS Development Planning Sessions Promo
|
title: Netlify CMS Development Planning Sessions Promo
|
||||||
url: >-
|
url: >-
|
||||||
https://www.eventbrite.com/e/netlify-cms-planning-session-bi-weekly-tickets-35794058994
|
https://www.eventbrite.com/e/netlify-cms-planning-session-bi-weekly-tickets-35794058994
|
||||||
- loud: true
|
- loud: true
|
||||||
message: >-
|
message: >-
|
||||||
We have a community on Gitter - join now to ask questions and discuss the
|
We have a community on Gitter - join now to ask questions and discuss the
|
||||||
project with other devs!
|
project with other devs!
|
||||||
published: false
|
published: false
|
||||||
title: Gitter shoutout
|
title: Gitter shoutout
|
||||||
url: 'https://gitter.im/netlify/netlifycms'
|
url: 'https://gitter.im/netlify/netlifycms'
|
||||||
- loud: true
|
- loud: true
|
||||||
message: >-
|
message: >-
|
||||||
Netlify CMS now supports GitLab!
|
Netlify CMS now supports GitLab!
|
||||||
published: false
|
published: false
|
||||||
title: GitLab announcement
|
title: GitLab announcement
|
||||||
url: '/blog/2018/06/netlify-cms-now-supports-gitlab-as-a-backend/'
|
url: '/blog/2018/06/netlify-cms-now-supports-gitlab-as-a-backend/'
|
||||||
- loud: true
|
- loud: true
|
||||||
message: >-
|
message: >-
|
||||||
Announcing 2.0 - Bitbucket support and monorepo architecture!
|
Announcing 2.0 - Bitbucket support and monorepo architecture!
|
||||||
published: true
|
published: true
|
||||||
title: 2.0 announcement
|
title: 2.0 announcement
|
||||||
url:
|
url: '/blog/2018/07/netlify-cms-2-0-launches-with-bitbucket-support-and-a-new-monorepo-architecture'
|
||||||
'/blog/2018/07/netlify-cms-2-0-launches-with-bitbucket-support-and-a-new-monorepo-architecture'
|
|
||||||
|
@ -6,36 +6,31 @@ backend:
|
|||||||
|
|
||||||
publish_mode: editorial_workflow
|
publish_mode: editorial_workflow
|
||||||
|
|
||||||
media_folder: 'website/static/img' # Folder where user uploaded files should go
|
media_folder: "website/static/img" # Folder where user uploaded files should go
|
||||||
public_folder: 'img'
|
public_folder: "img"
|
||||||
|
|
||||||
collections: # A list of collections the CMS should be able to edit
|
collections: # A list of collections the CMS should be able to edit
|
||||||
- name: 'docs' # Used in routes, ie.: /admin/collections/:slug/edit
|
- name: "docs" # Used in routes, ie.: /admin/collections/:slug/edit
|
||||||
label: 'Docs' # Used in the UI, ie.: "New Post"
|
label: "Docs" # Used in the UI, ie.: "New Post"
|
||||||
folder: 'website/content/docs' # The path to the folder where the documents are stored
|
folder: "website/content/docs" # The path to the folder where the documents are stored
|
||||||
create: true # Allow users to create new documents in this collection
|
create: true # Allow users to create new documents in this collection
|
||||||
fields: # The fields each document in this collection have
|
fields: # The fields each document in this collection have
|
||||||
- { label: 'Title', name: 'title', widget: 'string', tagname: 'h1' }
|
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
|
||||||
- { label: 'Group', name: 'group', widget: 'string' }
|
- {label: "Group", name: "group", widget: "string"}
|
||||||
- { label: 'Weight', name: 'weight', widget: 'number' }
|
- {label: "Weight", name: "weight", widget: "number"}
|
||||||
- { label: 'Body', name: 'body', widget: 'markdown' }
|
- {label: "Body", name: "body", widget: "markdown"}
|
||||||
- name: 'blog'
|
- name: "blog"
|
||||||
label: 'Blog'
|
label: "Blog"
|
||||||
label_singular: 'Post'
|
label_singular: "Post"
|
||||||
folder: 'website/site/content/blog'
|
folder: "website/site/content/blog"
|
||||||
create: true
|
create: true
|
||||||
fields:
|
fields:
|
||||||
- { label: 'Title', name: 'title', widget: 'string', tagname: 'h1' }
|
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
|
||||||
- { label: 'Author', name: 'author', widget: 'string' }
|
- {label: "Author", name: "author", widget: "string"}
|
||||||
- { label: 'Description (for blog list)', name: 'description', widget: 'text' }
|
- {label: "Description (for blog list)", name: "description", widget: "text"}
|
||||||
- {
|
- {label: "Meta Description (defaults to Description)", name: "meta_description", widget: "text", required: false}
|
||||||
label: 'Meta Description (defaults to Description)',
|
- {label: "Date", name: "date", widget: "date"}
|
||||||
name: 'meta_description',
|
- {label: "Body", name: "body", widget: "markdown"}
|
||||||
widget: 'text',
|
|
||||||
required: false,
|
|
||||||
}
|
|
||||||
- { label: 'Date', name: 'date', widget: 'date' }
|
|
||||||
- { label: 'Body', name: 'body', widget: 'markdown' }
|
|
||||||
- name: updates
|
- name: updates
|
||||||
label: Updates
|
label: Updates
|
||||||
files:
|
files:
|
||||||
@ -47,9 +42,9 @@ collections: # A list of collections the CMS should be able to edit
|
|||||||
label: Releases
|
label: Releases
|
||||||
widget: list
|
widget: list
|
||||||
fields:
|
fields:
|
||||||
- { name: version, label: Version }
|
- {name: version, label: Version}
|
||||||
- { name: date, label: Date, widget: date }
|
- {name: date, label: Date, widget: date}
|
||||||
- { name: description, label: Description }
|
- {name: description, label: Description}
|
||||||
- name: notifications
|
- name: notifications
|
||||||
label: Notifications
|
label: Notifications
|
||||||
file: website/data/notifications.yml
|
file: website/data/notifications.yml
|
||||||
@ -59,8 +54,8 @@ collections: # A list of collections the CMS should be able to edit
|
|||||||
label: Notifications
|
label: Notifications
|
||||||
widget: list
|
widget: list
|
||||||
fields:
|
fields:
|
||||||
- { label: Title, name: title, widget: string, tagname: h1 }
|
- {label: Title, name: title, widget: string, tagname: h1}
|
||||||
- { label: Published, name: published, widget: boolean }
|
- {label: Published, name: published, widget: boolean}
|
||||||
- { label: Loud, name: loud, widget: boolean }
|
- {label: Loud, name: loud, widget: boolean}
|
||||||
- { label: Message, name: message, widget: text }
|
- {label: Message, name: message, widget: text}
|
||||||
- { label: URL, name: url }
|
- {label: URL, name: url}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user