mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor(client): source superblock intros from curriculum (#66328)
This commit is contained in:
committed by
GitHub
parent
e8052b52c2
commit
b72d31c209
@@ -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
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user