Skip to content

Instantly share code, notes, and snippets.

@Necmttn
Created October 8, 2017 15:21
Show Gist options
  • Save Necmttn/3e8e4dbf7900c4fccf9ba579aae92a44 to your computer and use it in GitHub Desktop.
Save Necmttn/3e8e4dbf7900c4fccf9ba579aae92a44 to your computer and use it in GitHub Desktop.
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