Skip to content

Instantly share code, notes, and snippets.

@sumitkharche
Created June 26, 2019 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sumitkharche/063f8835bd76505682914e23bfa2fe20 to your computer and use it in GitHub Desktop.
Save sumitkharche/063f8835bd76505682914e23bfa2fe20 to your computer and use it in GitHub Desktop.
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