Gatsby uses PageContext to pass additional information into a React component. In this lesson we will update our Tag page templates to display data.
To be able to display the title of a post by {post.frontmatter.title}
, in singleTagIndex.js
should be added in gatsby-node.js
in graphql query in frontmatter a title.
Missing comma in the transcript after singleTagIndexTemplate
createPage({
path: '/tags/${tagName}',
component: singleTagIndexTemplate,
context: {
posts,
tagName
}
})
})