This commit is contained in:
hamdy
2020-11-30 14:02:35 +02:00
parent d6f625c943
commit fbd2da391a
3 changed files with 95 additions and 10 deletions

View File

@@ -212,4 +212,38 @@ module.exports = function(api) {
});
});
api.createPages(async({
graphql,
createPage
}) => {
// Use the Pages API here: https://gridsome.org/docs/pages-api
const {
data
} = await graphql(`{
allNewsTag {
edges {
node {
id
path
}
}
}
}
`);
data.allNewsTag.edges.forEach(function(element) {
createPage({
path: element.node.path,
component: './src/templates/Tag.vue',
context: {
id: element.node.id
}
});
});
});
}