Test performance improvements by trimming views

This commit is contained in:
Angelos Chalaris
2019-08-16 13:47:46 +03:00
parent a2612fbf1b
commit 7df5cd4a8c
13 changed files with 27 additions and 56 deletions

View File

@ -42,17 +42,12 @@ exports.createPages = ({ graphql, actions }) => {
const snippets = result.data.allMarkdownRemark.edges;
snippets.forEach((post, index) => {
const previous =
index === snippets.length - 1 ? null : snippets[index + 1].node;
const next = index === 0 ? null : snippets[index - 1].node;
createPage({
path: post.node.fields.slug,
component: snippetPage,
context: {
slug: post.node.fields.slug,
previous,
next,
},
});
});
@ -73,7 +68,6 @@ exports.createPages = ({ graphql, actions }) => {
component: tagPage,
context: {
tag,
tagRegex,
},
});
});