Started work on multiple post authors, still a few bugs to work out

This commit is contained in:
Alex Dueppen
2019-08-12 15:17:34 -05:00
parent f65b06466f
commit b072a6cd41
14 changed files with 75 additions and 25 deletions

View File

@@ -35,7 +35,7 @@ exports.sourceNodes = ({ getNodesByType, actions: { createNodeField } }) => {
const unicornNodes = getNodesByType(`UnicornsJson`)
unicornNodes.forEach(unicornNode => {
const isAuthor = postNodes.some(post => post.frontmatter.author === unicornNode.id)
const isAuthor = postNodes.some(post => post.frontmatter.authors.includes(unicornNode.id)) //changed
createNodeField({
name: `isAuthor`,
@@ -65,7 +65,7 @@ exports.createPages = ({ graphql, actions }) => {
}
frontmatter {
title
author {
authors {
id
}
}