mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-09 21:07:49 +00:00
Started work on multiple post authors, still a few bugs to work out
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user