How to use the netlify-cms.registerPreviewTemplate function in netlify-cms

To help you get started, we’ve selected a few netlify-cms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github danielmahon / gatsby-starter-procyon / src / cms / cms.js View on Github external
});
      });
      CMS.registerPreviewStyle(sheets.toString(), { raw: true });
    }
    render() {
      // Wraps the input component in a container, without mutating it. Good!
      return <template>;
    }
  }
  return withRoot(StyledTemplate);
}

CMS.registerPreviewStyle(globalStyles);
CMS.registerPreviewTemplate('home', withPreviewStyles(HomePagePreview));
CMS.registerPreviewTemplate('about', withPreviewStyles(AboutPagePreview));
CMS.registerPreviewTemplate('blog', withPreviewStyles(BlogPostPreview));
</template>
github P233 / gatsby-netlify-i18n-workaround / src / cms / cms.js View on Github external
import CMS from "netlify-cms"

import HomePagePreview from "./preview-templates/HomePagePreview"
import AboutPagePreview from "./preview-templates/AboutPagePreview"
import BlogPagePreview from "./preview-templates/BlogPagePreview"

CMS.registerPreviewTemplate("index-en", HomePagePreview)
CMS.registerPreviewTemplate("index-cn", HomePagePreview)

CMS.registerPreviewTemplate("about-en", AboutPagePreview)
CMS.registerPreviewTemplate("about-cn", AboutPagePreview)

CMS.registerPreviewTemplate("blog-en", BlogPagePreview)
CMS.registerPreviewTemplate("blog-cn", BlogPagePreview)
github Jinksi / gatsbro / src / cms / cms.js View on Github external
import React from 'react'
import CMS from 'netlify-cms'
import './cms-utils'

import { HomePageTemplate } from '../templates/HomePage'
import { AboutPageTemplate } from '../templates/AboutPage'
import { ContactPageTemplate } from '../templates/ContactPage'
import { DefaultPageTemplate } from '../templates/DefaultPage'
import { BlogIndexTemplate } from '../templates/BlogIndex'
import { SinglePostTemplate } from '../templates/SinglePost'

CMS.registerPreviewStyle('/styles.css')

CMS.registerPreviewTemplate('home-page', ({ entry }) =&gt; (
  
))
CMS.registerPreviewTemplate('about-page', ({ entry }) =&gt; (
  
))
CMS.registerPreviewTemplate('contact-page', ({ entry }) =&gt; (
  
))
CMS.registerPreviewTemplate('infoPages', ({ entry }) =&gt; (
  
))
CMS.registerPreviewTemplate('blog-page', ({ entry }) =&gt; (
  
))
CMS.registerPreviewTemplate('posts', ({ entry }) =&gt; (
github QardsJs / qards / src / cms / cms.ts View on Github external
//	register editor components
CMS.registerEditorComponent(Code);
CMS.registerEditorComponent(Audio);
CMS.registerEditorComponent(Video);
CMS.registerEditorComponent(Image);
CMS.registerEditorComponent(Reveal);
CMS.registerEditorComponent(Calout);
CMS.registerEditorComponent(Divider);
CMS.registerEditorComponent(Gallery);
CMS.registerEditorComponent(Reference);
CMS.registerEditorComponent(Countdown);
CMS.registerEditorComponent(SectionHeading);

//	register previews
CMS.registerPreviewTemplate('posts', PostsPreview);
github netlify / netlify-cms / website / src / cms / cms.js View on Github external
);

const NotificationPreview = ({ entry }) =&gt;
  entry
    .getIn(['data', 'notifications'])
    .filter(notif =&gt; notif.get('published'))
    .map((notif, idx) =&gt; (
      
        {notif.get('message')}
      
    ));

CMS.registerPreviewTemplate('blog', withHighlight(BlogPostPreview));
CMS.registerPreviewTemplate('docs', withHighlight(DocsPreview));
CMS.registerPreviewTemplate('widget_docs', withHighlight(WidgetDocPreview));
CMS.registerPreviewTemplate('releases', ReleasePreview);
CMS.registerPreviewTemplate('notifications', NotificationPreview);
CMS.registerPreviewTemplate('community', CommunityPreview);
github netlify / netlify-cms / website / src / cms / cms.js View on Github external
const NotificationPreview = ({ entry }) =&gt;
  entry
    .getIn(['data', 'notifications'])
    .filter(notif =&gt; notif.get('published'))
    .map((notif, idx) =&gt; (
      
        {notif.get('message')}
      
    ));

CMS.registerPreviewTemplate('blog', withHighlight(BlogPostPreview));
CMS.registerPreviewTemplate('docs', withHighlight(DocsPreview));
CMS.registerPreviewTemplate('widget_docs', withHighlight(WidgetDocPreview));
CMS.registerPreviewTemplate('releases', ReleasePreview);
CMS.registerPreviewTemplate('notifications', NotificationPreview);
CMS.registerPreviewTemplate('community', CommunityPreview);
github ajmalafif / netsby / src / cms / cms.js View on Github external
import CMS from 'netlify-cms'

import IndexPagePreview from './preview-templates/IndexPagePreview'
import AboutPagePreview from './preview-templates/AboutPagePreview'
import BlogPostPreview from './preview-templates/BlogPostPreview'
import ExperiencePagePreview from './preview-templates/ExperiencePagePreview'

CMS.registerPreviewTemplate('homepage', IndexPagePreview)
CMS.registerPreviewTemplate('about', AboutPagePreview)
CMS.registerPreviewTemplate('experience', ExperiencePagePreview)
CMS.registerPreviewTemplate('blog', BlogPostPreview)