feat(config): allow config.yml file load to be skipped (#2053)
This commit is contained in:
committed by
Shawn Erquhart
parent
22e047e723
commit
14f94a022c
@ -134,6 +134,35 @@ init({
|
||||
},
|
||||
})
|
||||
|
||||
/**
|
||||
* Optionally pass in a complete config object and set a flag
|
||||
* (`load_config_file: false`) to ignore the `config.yml`.
|
||||
*
|
||||
* For example, the code below contains a complete config. The
|
||||
* `config.yml` will be ignored when setting `load_config_file` to false.
|
||||
* It is not required if the `config.yml` file is missing to set
|
||||
* `load_config_file`, but will improve performance and avoid a load error.
|
||||
*/
|
||||
|
||||
init({
|
||||
config: {
|
||||
backend: {
|
||||
name: 'git-gateway',
|
||||
},
|
||||
load_config_file: false,
|
||||
media_folder: "static/images/uploads",
|
||||
public_folder: "/images/uploads",
|
||||
collections: [
|
||||
{ label: "Blog", name: "blog", folder: "_posts/blog", create: true, fields: [
|
||||
{ label: "Title", name: "title", widget: "string" },
|
||||
{ label: "Publish Date", name: "date", widget: "datetime" },
|
||||
{ label: "Featured Image", name: "thumbnail", widget: "image" },
|
||||
{ label: "Body", name: "body", widget: "markdown" },
|
||||
]},
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
// The registry works as expected, and can be used before or after init.
|
||||
CMS.registerPreviewTemplate(...);
|
||||
```
|
||||
|
Reference in New Issue
Block a user