Skip to content

Commit

Permalink
docs: update manual init docs (#3815)
Browse files Browse the repository at this point in the history
  • Loading branch information
erezrokah committed May 26, 2020
1 parent 624b7ff commit 90ebee9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions website/content/docs/beta-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,7 @@ You can now provide your own element for Netlify CMS to mount in by setting the

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.

Assuming you have the netlify-cms package installed to your project, manual initialization works like this:
Assuming you have the netlify-cms package installed to your project, manual initialization works by setting `window.CMS_MANUAL_INIT = true` **before importing the CMS**:

```js
// This global flag enables manual initialization.
Expand Down

0 comments on commit 90ebee9

Please sign in to comment.