-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Build markdown nodes from CMS RichText fields (#98)
* feat: Build markdown nodes for CMS markdown fields Can be used with MDX * feat: Add buildMarkdownNodes configuration option Defaults to false * style: Linting * chore(demo): Add MDX dependencies * chore(demo): Update demo to use MDX * fix: Remove optional chaining Eventually transpile with Babel * docs: Update README to include markdownNode usage * docs: Add link to demo source For a full MDX example
- Loading branch information
Jonathan Steele
authored
Jul 31, 2020
1 parent
f820c81
commit fb77241
Showing
10 changed files
with
1,020 additions
and
45 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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
import React from 'react' | ||
import { MDXProvider } from '@mdx-js/react' | ||
|
||
import Layout from './src/components/layout' | ||
import Parargraph from './src/components/paragraph' | ||
|
||
import './src/styles/main.css' | ||
|
||
const wrapPageElement = ({ element, props }) => { | ||
return <Layout {...props}>{element}</Layout> | ||
} | ||
|
||
export { wrapPageElement } | ||
const wrapRootElement = ({ element }) => { | ||
return <MDXProvider components={{ p: Parargraph }}>{element}</MDXProvider> | ||
} | ||
|
||
export { wrapPageElement, wrapRootElement } |
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 @@ | ||
export { wrapPageElement } from './gatsby-browser' | ||
export { wrapPageElement, wrapRootElement } from './gatsby-browser' |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react' | ||
|
||
function Paragraph(props) { | ||
return <p className="leading-relaxed md:text-xl text-lg" {...props} /> | ||
} | ||
|
||
export default Paragraph |
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
Oops, something went wrong.