Tag and category pages
This commit is contained in:
@@ -33,6 +33,11 @@ exports.createPages = async ({ graphql, actions }) => {
|
||||
fieldValue
|
||||
}
|
||||
}
|
||||
categoriesGroup: allMarkdownRemark {
|
||||
group(field: frontmatter___categories) {
|
||||
fieldValue
|
||||
}
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
@@ -55,4 +60,14 @@ exports.createPages = async ({ graphql, actions }) => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
result.data.categoriesGroup.group.forEach((category) => {
|
||||
createPage({
|
||||
path: `/categories/${category.fieldValue}/`,
|
||||
component: path.resolve(`./src/templates/category.js`),
|
||||
context: {
|
||||
category: category.fieldValue
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user