Fetching Blog Posts config
This commit is contained in:
@@ -1,9 +1,23 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import Link from 'gatsby-link'
|
||||||
|
|
||||||
class Blog extends Component {
|
class Blog extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { data } = this.props
|
const data = this.props.data
|
||||||
return <div>Blog Page</div>
|
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>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user