mirror of
https://github.com/Unkn0wnCat/KevinK.dev.js.git
synced 2025-05-10 15:36:57 +02:00
Add scambox
This commit is contained in:
parent
31fd2e5755
commit
5c17277817
16 changed files with 611 additions and 97 deletions
|
@ -6,6 +6,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
|||
const { createPage } = actions;
|
||||
|
||||
const projectTemplate = path.resolve(`src/templates/project.js`);
|
||||
const scamboxTemplate = path.resolve(`src/templates/scamboxPost.js`);
|
||||
|
||||
const result = await graphql(`
|
||||
query AllPagesQuery {
|
||||
|
@ -15,6 +16,23 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
|||
urlname
|
||||
}
|
||||
}
|
||||
|
||||
scambox: allFile(
|
||||
filter: { sourceInstanceName: { eq: "scamboxContent" } }
|
||||
) {
|
||||
nodes {
|
||||
childMdx {
|
||||
id
|
||||
body
|
||||
frontmatter {
|
||||
platform
|
||||
tags
|
||||
title
|
||||
url
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
|
@ -40,6 +58,26 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
|||
},
|
||||
});
|
||||
});
|
||||
|
||||
result.data.scambox.nodes.forEach((node) => {
|
||||
if (!node.childMdx) return;
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
console.log(
|
||||
"Creating Page: ",
|
||||
`/*/scambox/${node.childMdx.frontmatter.url}`
|
||||
);
|
||||
|
||||
//["en", "de"].forEach((lang) => {
|
||||
createPage({
|
||||
path: `/scambox/${node.childMdx.frontmatter.url}`,
|
||||
component: scamboxTemplate,
|
||||
context: {
|
||||
mdxId: node.childMdx.id,
|
||||
},
|
||||
});
|
||||
//})
|
||||
});
|
||||
};
|
||||
|
||||
const config = require("./config.js");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue