Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the _preview_templates parameter
To register preview templates: 1. Save preview templates in "assets/decap-cms/preview/templates" folders, it's recommended using a special subfolder, such as app, site or custom. The preview template MUST export a default class as follows. ```typescript // assets/decap-cms/preview/templates/app/title.ts export default createClass({ render: function() => { return h('div', {}, this.props.entry.getIn(['data', 'title'])}; } }) ``` 2. Then configure the preview templates for collections. ``` params: decap_cms: _preview_templates: - name: 'app/title' # the filename of preview template. collections: ['news', 'posts'] # which collections will apply this preview template. ```
- Loading branch information