netlify-cms-widget-relation-create
v0.0.23
Published
A widget to create new item for collection with relation
Downloads
12
Maintainers
Readme
Netlify CMS Widget For Relation Widgets with ability to create a new one
Development
To run a copy of Netlify CMS with your widget loaded for development, use the start script:
npm start
Production & Publishing
You'll want to take a few steps before publishing a production built package to npm:
- Customize
package.json
with details for your specific widget, e.g. name, description, author, version, etc. - For discoverability, ensure that your package name follows the pattern
netlify-cms-widget-<name>
. - Rename the exports in
src/index.js
. For example, if your widget isnetlify-cms-widget-awesome
, you would do:
if (typeof window !== 'undefined') {
window.RelationCreateControl = RelationCreateControl
window.RelationCreatePreview = RelationCreatePreview
}
export { Control as RelationCreateControl, Preview as RelationCreatePreview }
Deploying a live demo
The development (start) task provides a locally served preview of your widget in the CMS editor. This starter also includes a demo
task for deploying this view live. Here's how to get your demo deployed using Netlify.
- Assuming your repo is on GitHub, head over to Netlify and create a site from your repo.
- The proper settings will be pre-filled based on what's in the
netlify.toml
file in this repo, so you can just click through to deploy. - Add your deployed site url to
README.md
, replacing the placeholder url in the demo link.