refactor(client): source superblock intros from curriculum (#66328)

This commit is contained in:
Oliver Eyton-Williams
2026-03-11 16:53:10 +01:00
committed by GitHub
parent e8052b52c2
commit b72d31c209
80 changed files with 26 additions and 928 deletions
+3 -19
View File
@@ -164,28 +164,12 @@ function getProjectPreviewConfig(challenge, allChallengeNodes) {
}
exports.createSuperBlockIntroPages = function (createPage) {
return function (edge) {
const {
fields: { slug },
frontmatter: { superBlock, certification, title }
} = edge.node;
if (!certification) {
throw Error(
`superBlockIntro page, '${superBlock}' must have certification in frontmatter`
);
}
// TODO: throw if it encounters an unknown certification. Also, handle
// coding-interview-prep. it's not a certification, but it is a superBlock.
return function ({ superBlock }) {
createPage({
path: slug,
path: `/learn/${superBlock}/`,
component: superBlockIntro,
context: {
certification,
superBlock,
title
superBlock
}
});
};