2018-07-05 20:43:56 +02:00
|
|
|
import React, { Component } from 'react'
|
2018-07-05 20:56:44 +02:00
|
|
|
import Link from 'gatsby-link'
|
2018-07-05 20:43:56 +02:00
|
|
|
|
2018-07-06 09:35:17 +02:00
|
|
|
import Card from '../components/Card'
|
|
|
|
|
|
2018-07-05 20:43:56 +02:00
|
|
|
class Blog extends Component {
|
|
|
|
|
render() {
|
2018-07-05 20:56:44 +02:00
|
|
|
const data = this.props.data
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<h1>Blog Posts</h1>
|
|
|
|
|
{data.allWordpressPost.edges.map(({ node }) => (
|
2018-07-06 09:35:17 +02:00
|
|
|
<Card
|
|
|
|
|
url={`blog/${node.slug}`}
|
|
|
|
|
title={node.title}
|
|
|
|
|
postId={node.slug}
|
|
|
|
|
date={node.date}
|
|
|
|
|
excerpt={node.excerpt}
|
|
|
|
|
/>
|
2018-07-05 20:56:44 +02:00
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
2018-07-05 20:43:56 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const query = graphql`
|
|
|
|
|
query blogQuery {
|
|
|
|
|
allWordpressPost {
|
|
|
|
|
edges {
|
|
|
|
|
node {
|
|
|
|
|
id
|
|
|
|
|
title
|
|
|
|
|
excerpt
|
|
|
|
|
slug
|
|
|
|
|
date(formatString: "MMMM DD, YYYY")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
|
|
|
|
|
export default Blog
|