7.6 KiB
Curriculum File Structure
Our core instructional content is located within the conveniently named curriculum directory. This page will break down how these files are organized.
Terminology
There are a few terms we use when discussing our curriculum content.
certification: When referring to a certification in this instance, it is talking about the actual certificate that users claim. Which is separate from the name of the superBlock.superBlock: A superblock is the top level collection of challenges. Each superblock corresponds to a certification in the curriculum (i.e. Responsive Web Design).block: A block is a section within a superblock. A block corresponds to a group of challenges in a given certification (i.e. Basic HTML and HTML5)challenge: A challenge is a single lesson within the curriculum (i.e. Say Hello to HTML Elements)
File Tree
Using those terms, here is how the file structure would be defined:
curriculum/
├─ _meta/
│ ├─ {block}/
│ │ ├─ meta.json
├─ {language}/
│ ├─ {superBlock}/
│ │ ├─ {block}/
│ │ │ ├─ {challenge}.md
The _meta Directory
The _meta directory is a special directory which contains .json files. These files correspond to each block in the curriculum, and are used to determine which superBlock a block belongs to, and the order of the challenges within that block.
Renaming Files
There may be times when you need to rename a certificate, superblock, block, or challenge. This section will outline the steps needed to avoid build errors when doing so.
[!ATTENTION] Renaming files within the curriculum structure will often change the path (or URL) of the content on the main webpage. Doing so should be done with care, as redirects have to be set up for each change that is made.
Renaming a Certification
When renaming a certification, you will likely want to rename the associated superblock along with it. Do the following to rename only the certificate:
- Rename the
curriculum/challenges/_meta/{superBlock}-certificatefolder to the new name. - In the
meta.jsonfile of that folder, rename the values inname,dashedName, andchallengeOrderto the new cert name. - In
curriculum/challenges/english/12-certificate, rename the{superBlock}-certificatefolder, and the YAML file within it, to the new name. - In the YAML file, change the
titleto the new name. - Rename the file and folder from step 3 for the rest curriculum languages.
- Update
client/src/redux/index.tsto use the correcttitle. - Optionally, update the
certSlugfor the superblock in the same file. Note that renaming acertSlugwill change the URL for certifications and should only be done with careful consideration. - Update the
titleinclient/src/resources/cert-and-project-map.tsto the new value. Note that changing thetitlehere will break the superBlock page for the associated certification. It relies on the superBlock title to match the certification title. You will likely want to rename the superBlock at the same time. - If you renamed the
certSlugin step 7, change it here for the cert and all the nestedprojectsvalues. - In
config/certification-settings.js, update the value ofcertTypeTitleMapto the new name. - If you renamed the
certSlugin step 7, update the key ofcertSlugTypeMapin the same file. - Update the certificate name in the
legacyCertsarray of theclient/src/client-only-routes/show-project-links.tsxif needed. - Update the main
README.mdfile to the new name.
Renaming a Superblock
Note
When you rename a superBlock, the new folder name is used as the path and should be considered the "correct" name. All other values should be updated to reflect that change.
Also, you will likely want to rename the certificate and the {superBlock}-projects block when you rename a superBlock since they all shares a name. To rename only a superBlock you need to:
- Rename the superBlock folder in the
curriculum/challenges/englishdirectory. - Rename the superBlock folder in all other
curriculum/challenges/{language}directories. - For each block within that superBlock, update the
superBlockvalue in themeta.jsonfile to its dashedName. You don't need to rename any folders here. Do that when renaming a block. - Rename the superblock folder in
client/src/pages/learn. - Update the
index.mdfile in the above folder, changing thetitleandsuperBlockvalues to the new name. - For each block folder within the above, update the
index.mdto use the correctsuperBlockvalue. - In the
client/src/resources/cert-and-project-map.tsfile, update the path for the cert at the top of the file, and thetitlevalue for that superBlock. Note that changing thetitlehere will break the ability to view the actual certification for this superBlock. It relies on the superBlock title to match the certification title. You will likely want to rename the certification at the same time. - Update the
superBlockCertTypeMapkey inconfig/certification-settings.jsto the new superBlock name. - Update the path value in
client/src/assets/icons/index.tsx. - For each language in
client/i18n/locales, update theintro.jsonfile to use the new superBlockdashedName. In the English file, also update thetitle. - Check the
config/i18n/all-langs.jsfile to see if the superBlock is enabled in i18n builds. Update all the values where it is used. - Update the main
README.mdfile to the new name.
Renaming a Block
When renaming a curriculum block, you need to:
- Change the name of the block folder in the
curriculum/challenges/english/{superBlock}directory. - Change the name of the same block folder in all of the other language directories to match. These must all be the same as the English structure or the build will error out.
- Change the name of the block folder in the
_metadirectory. - Update the
nameanddashedNameproperty for that block'smeta.jsonfile. - Update the
client/utils/help-category-map.jsonto use the new block name as the key. - Update the block folder in
client/src/pages/learn/{superBlock}. - In the
index.mdfile of the above folder, update theblockvalue in the frontmatter. - In the
client/i18n/locales/{language}/intro.jsonfiles, update the block name to the new name for all the languages. In the Englishintro.jsonfile, update thetitleas well. - Update the main
README.mdfile to the new name.
Renaming a Challenge
When renaming a single challenge file, you need to:
- Change the name of the challenge file in the
curriculum/challenges/englishdirectory. - Change the name of the
titleanddashedNamewithin that file. - Change the name of the file, and the
dashedNamein those files for all of the other language directories to match. - Update the name of the challenge in the relevant
meta.jsonfile. The challenge names here are not used in the build, but provide a user-friendly way to identify the challenge order. - If the challenge is a certificate project, update the YAML file in
curriculum/english/12-certificates/<superBlock>to the new name. - If the challenge is a certificate project, update the
titleandlinkinclient/src/resources/cert-and-project-map.ts - If the challenge is a certificate project, update the main
README.mdfile to the new name.
The dashedName Property
The dashedName property is used to generate the URL path for the superblock, block, or challenge. These should generally match what the /utils/slugs.js helper would output for the file name.