Fix query for blog posts and featured image, add img package

This commit is contained in:
Moris Zen
2018-07-06 11:54:24 +02:00
parent 1641186ad5
commit 8d435d1ce6
4 changed files with 23 additions and 9 deletions

View File

@@ -7,15 +7,19 @@ class Blog extends Component {
render() {
const data = this.props.data
return (
<div>
<h1>Blog Posts</h1>
<div className="flex">
{data.allWordpressPost.edges.map(({ node }) => (
<Card
key={node.id}
url={`blog/${node.slug}`}
title={node.title}
postId={node.id}
date={node.date}
excerpt={node.excerpt}
image={
node.featured_media
? node.featured_media.localFile.childImageSharp.resolutions
: undefined
}
/>
))}
</div>