From bd0677dfd3cc6b169fdaeb8ccbe49739fadf45b9 Mon Sep 17 00:00:00 2001 From: alxshelepenok Date: Tue, 13 Nov 2018 17:14:46 +0300 Subject: [PATCH] Fix preview templates --- src/cms/cms.js | 4 ++-- src/cms/preview-templates/page-preview.js | 8 ++++---- src/cms/preview-templates/post-preview.js | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/cms/cms.js b/src/cms/cms.js index fde8b83..9e44fda 100644 --- a/src/cms/cms.js +++ b/src/cms/cms.js @@ -2,5 +2,5 @@ import CMS from 'netlify-cms'; import PagePreview from './preview-templates/page-preview'; import PostPreview from './preview-templates/post-preview'; -CMS.registerPreviewTemplate('page', PagePreview); -CMS.registerPreviewTemplate('post', PostPreview); +CMS.registerPreviewTemplate('pages', PagePreview); +CMS.registerPreviewTemplate('posts', PostPreview); diff --git a/src/cms/preview-templates/page-preview.js b/src/cms/preview-templates/page-preview.js index 9bc46f6..f91195a 100644 --- a/src/cms/preview-templates/page-preview.js +++ b/src/cms/preview-templates/page-preview.js @@ -1,14 +1,14 @@ import React from 'react'; -import { Page } from '../../components/Page'; const PagePreview = ({ entry, widgetFor }) => { const body = widgetFor(['body']); const title = entry.getIn(['data', 'title']); return ( - -
- +
+

{title}

+
+
); }; diff --git a/src/cms/preview-templates/post-preview.js b/src/cms/preview-templates/post-preview.js index 4386df8..bf64eb2 100644 --- a/src/cms/preview-templates/post-preview.js +++ b/src/cms/preview-templates/post-preview.js @@ -1,12 +1,14 @@ import React from 'react'; -import { Content } from '../../components/Post/Content'; const PostPreview = ({ entry, widgetFor }) => { const body = widgetFor(['body']); const title = entry.getIn(['data', 'title']); return ( - +
+

{title}

+
+
); };