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
|
|
|
|
|
|
|
|
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 }) => (
|
|
|
|
|
<article key={node.slug}>
|
|
|
|
|
<Link to={`post/${node.slug}`}>
|
|
|
|
|
<h3>{node.title}</h3>
|
|
|
|
|
</Link>
|
|
|
|
|
{node.date}
|
|
|
|
|
<p dangerouslySetInnerHTML={{ __html: node.excerpt }} />
|
|
|
|
|
</article>
|
|
|
|
|
))}
|
|
|
|
|
</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
|