/app
/components
component.jsx
/content
/page1/
file.md
image.png
Last active
November 25, 2016 23:56
-
-
Save chrisdmacrae/130e00d8099b929386f5eb30414a0668 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Component.jsx recieves the frontmatter and content from the markdown as props | |
// e.g, this.props.title, this.props.image | |
const Component = () => { | |
let req = require.context("../content", true, /^\.\/.*\.png$/); | |
let image = req.resolve(this.props.image) | |
return( | |
<div> | |
<img src={image} /> | |
</div> | |
} | |
} |
This file contains hidden or 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
- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment