forked from hupe1980/gatsby-theme-material-ui
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hupe1980
authored and
hupe1980
committed
May 7, 2019
1 parent
07e23d7
commit a26811e
Showing
12 changed files
with
258 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './src/components'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as Post } from './post'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
packages/gatsby-theme-material-ui-blog/src/components/post.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
import CMS from 'netlify-cms'; | ||
import CMS, { init } from 'netlify-cms-app'; | ||
import FileSystemBackend from 'netlify-cms-backend-fs'; | ||
import { MdxControl, MdxPreview } from 'netlify-cms-widget-mdx'; | ||
|
||
import BlogPostPreview from './preview-templates/blog-post-preview'; | ||
|
||
// If running in development | ||
if (process.env.NODE_ENV === 'development') { | ||
window.CMS_ENV = 'development_overrides'; // Set the CMS_ENV to the development_ overrides. | ||
CMS.registerBackend('file-system', FileSystemBackend); // Register the FileSystemBackend. | ||
} | ||
|
||
CMS.registerWidget('mdx', MdxControl, MdxPreview); | ||
CMS.registerPreviewTemplate('blog', BlogPostPreview); | ||
|
||
// Start NetlifyCMS | ||
init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import { Post } from 'gatsby-theme-material-ui-blog'; | ||
|
||
const BlogPostPreview = ({ entry, widgetFor }) => ( | ||
<Post content={widgetFor('body')} title={entry.getIn(['data', 'title'])} /> | ||
); | ||
|
||
export default BlogPostPreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
|
||
backend: | ||
name: git-gateway | ||
branch: master | ||
branch: master | ||
|
||
development_overrides: | ||
backend: | ||
name: file-system | ||
api_root: 'http://localhost:8000/api' | ||
|
||
media_folder: static/img | ||
public_folder: /img | ||
|
||
|
||
collections: | ||
- label: "Blog" | ||
name: "mdx" | ||
folder: "content/posts" | ||
extension: mdx | ||
format: frontmatter | ||
widget: mdx | ||
create: true | ||
fields: | ||
- {label: "Title", name: "title", widget: "string"} | ||
- {label: "Publish Date", name: "date", widget: "datetime"} | ||
- {label: "Body", name: "body", widget: "mdx"} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.