Update remaining pages

Everything that used remark and JSON now uses the new Snippet schema
This commit is contained in:
Angelos Chalaris
2019-09-17 00:15:31 +03:00
parent 75c4b3321b
commit 48f921b975
4 changed files with 101 additions and 108 deletions

View File

@ -225,7 +225,6 @@ exports.createPages = ({ graphql, actions }) => {
tags: node.tags.all,
id: node.slug.slice(1)
}));
const tagRegex = `/^\\s*${tag}/`;
createPage({
path: tagPath,
component: tagPage,
@ -236,12 +235,22 @@ exports.createPages = ({ graphql, actions }) => {
});
});
const beginnerSnippets = snippets
.filter(({ node }) => node.tags.all.includes('beginner'))
.filter(snippet => !snippet.node.archived)
.map(({ node }) => ({
title: node.title,
html: node.html.text,
tags: node.tags.all,
id: node.slug.slice(1)
}));
createPage({
path: `/beginner`,
component: tagPage,
context: {
tag: `beginner snippets`,
tagRegex: `/beginner/`,
snippets: beginnerSnippets
},
});