Skip to content

Instantly share code, notes, and snippets.

@christiannwamba
Created January 30, 2018 14:58
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 christiannwamba/72d92e1872723d9e6536da69552d6a4e to your computer and use it in GitHub Desktop.
Save christiannwamba/72d92e1872723d9e6536da69552d6a4e to your computer and use it in GitHub Desktop.
...
export default ({ data }) => {
console.log(data)
return (
<div>
<h4>
{data.allMarkdownRemark.totalCount} Posts
</h4>
{data.allMarkdownRemark.edges.map(({ node }) =>
<div key={node.id}>
<Link
to={node.fields.slug}
style={{ textDecoration: `none`, color: `inherit` }}
>
<h2>
{node.frontmatter.title}{" "}
<span style={{color:`grey`, fontSize:`0.7em`}}>— {node.frontmatter.date}</span>
</h2>
<p>
{node.excerpt}
</p>
<h5>
By {node.frontmatter.author}
</h5>
</Link>
</div>
)}
</div>
)
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment