Skip to content

Instantly share code, notes, and snippets.

@sumitkharche sumitkharche/post.js
Created Jun 26, 2019

Embed
What would you like to do?
post.js
import React from 'react'
import {withRouteData} from 'react-static'
import Markdown from "react-markdown";
import { Link } from 'components/Router'
export default withRouteData(({post}) => (
<React.Fragment>
<div className="content">
<Link to="/">{'<'} Back</Link>
</div>
<article>
<h1>{post.metadata.title}</h1>
<div>
<img
alt={post.metadata.title}
src={post.metadata.image.url}
/>
</div>
<Markdown source={post.metadata.content} />
</article>
</React.Fragment>
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.