fix: rename superblock to use /2022/ (#44535)

* chore: update superblock properties

* refactor: remove isAudited from certs

It was always defaulting to English, anyway.

* refactor: get superblock from metas, not dirs

* fix: rename responsive-web-design-22

This converts the slugs to /2022/responsive-web-design

* refactor: remove unused export

* test: update test with new curriculum config

* refactor: use key not [key]

* refactor: remove directory reference from test
This commit is contained in:
Oliver Eyton-Williams
2021-12-21 18:35:51 +00:00
committed by GitHub
parent 198150217a
commit ff566d441a
28 changed files with 74 additions and 85 deletions

View File

@@ -66,7 +66,7 @@
}
}
},
"responsive-web-design-22": {
"2022/responsive-web-design": {
"title": "Responsive Web Design",
"intro": [
"In this Responsive Web Design Certification, you'll learn the languages that developers use to build webpages: HTML (Hypertext Markup Language) for content, and CSS (Cascading Style Sheets) for design.",

View File

@@ -1,6 +1,6 @@
---
title: Responsive Web Design
superBlock: responsive-web-design-22
superBlock: 2022/responsive-web-design
certification: responsive-web-design
---

View File

@@ -5,7 +5,7 @@ const { showNewCurriculum } = envData;
const responsiveWebBase =
'/learn/responsive-web-design/responsive-web-design-projects';
const responsiveWeb22Base = '/learn/responsive-web-design-22';
const responsiveWeb22Base = '/learn/2022/responsive-web-design';
const jsAlgoBase =
'/learn/javascript-algorithms-and-data-structures/' +
'javascript-algorithms-and-data-structures-projects';

View File

@@ -6,7 +6,6 @@ const envData = require('../../config/env.json');
const {
getChallengesForLang,
createChallenge,
createCertification,
challengesDir,
getChallengesDirForLang
} = require('../../curriculum/getChallenges');
@@ -26,11 +25,14 @@ exports.replaceChallengeNode = () => {
`../../curriculum/challenges/_meta/${blockName}/meta.json`
);
delete require.cache[require.resolve(metaPath)];
const isCert = path.extname(filePath) === '.yml';
const meta = require(metaPath);
return isCert
? await createCertification(challengesDir, filePath, curriculumLocale)
: await createChallenge(challengesDir, filePath, curriculumLocale, meta);
// TODO: reimplement hot-reloading of certifications
return await createChallenge(
challengesDir,
filePath,
curriculumLocale,
meta
);
};
};