docs: use netlify-cms-app instead of netlify-cms (#4287)

This commit is contained in:
Gavin Vaught 2020-09-20 08:22:18 -05:00 committed by GitHub
parent ba18f4a99f
commit c173d651a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,13 +61,15 @@ The second file, `admin/config.yml`, is the heart of your Netlify CMS installati
You can also use Netlify CMS as an npm module. Wherever you import Netlify CMS, it automatically runs, taking over the current page. Make sure the script that imports it only runs on your CMS page. First install the package and save it to your project:
```bash
npm install netlify-cms --save
npm install netlify-cms-app --save
```
Then import it (assuming your project has tooling for imports):
```js
import CMS from 'netlify-cms'
import CMS from 'netlify-cms-app'
// Initialize the CMS object
CMS.init()
// Now the registry is available via the CMS object.
CMS.registerPreviewTemplate('my-template', MyTemplate)
```