Skip to content

Commit

Permalink
Ignore tag pages that do not have posts associated with them.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwiemer committed Oct 18, 2018
1 parent c6bb0fc commit aae88d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ exports.createPages = ({ graphql, actions }) => {

// Create tag pages with pagination if needed
tags.map(({ node }) => {
const totalPosts = node.post.length
const totalPosts = node.post !== null ? node.post.length : 0
const numPages = Math.ceil(totalPosts / postsPerPage)
Array.from({ length: numPages }).forEach((_, i) => {
createPage({
Expand Down

0 comments on commit aae88d7

Please sign in to comment.