Skip to content

Commit

Permalink
Merge pull request #63 from terrierscript/blog-post-filter-as-gql
Browse files Browse the repository at this point in the history
Move blog-post filter to graphQL
AustinGreen authored May 21, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 32a8b79 + b663a84 commit e078bc9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@ export default class IndexPage extends React.Component {
<h1 className="has-text-weight-bold is-size-2">Latest Stories</h1>
</div>
{posts
.filter(post => post.node.frontmatter.templateKey === 'blog-post')
.map(({ node: post }) => (
<div
className="content"
@@ -54,7 +53,10 @@ IndexPage.propTypes = {

export const pageQuery = graphql`
query IndexQuery {
allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }) {
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] },
filter: { frontmatter: { templateKey: { eq: "blog-post" } }}
) {
edges {
node {
excerpt(pruneLength: 400)

0 comments on commit e078bc9

Please sign in to comment.