Created
October 8, 2017 15:21
-
-
Save Necmttn/3e8e4dbf7900c4fccf9ba579aae92a44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
const Blog = (props) => { | |
const posts = props.data.allMarkdownRemark.edges | |
return ( | |
<div> | |
<h1> blog pages </h1> | |
<ul> | |
{posts.map(post => { | |
const title = post.node.frontmatter.title | |
const excerpt = post.node.excerpt | |
return ( | |
<li> | |
<h1>{title}</h1> | |
<p>{excerpt}</p> | |
</li> | |
) | |
})} | |
</ul> | |
</div> | |
) | |
} | |
export const pageQuery = graphql` | |
query BlogEnQuery { | |
allMarkdownRemark{ | |
edges { | |
node{ | |
frontmatter{ | |
title, | |
}, | |
excerpt | |
} | |
} | |
} | |
} | |
`; | |
export default Blog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment