8.0 KiB
Estructura de archivos del currículo
Nuestro contenido instructivo principal se encuentra dentro del directorio convenientemente llamado curriculum
. Esta página desglosará cómo están organizados estos archivos.
Terminología
Hay algunos términos que usamos cuando hablamos del contenido de nuestro currículo.
certification
: Cuando se hace referencia a una certificación en este caso, se está hablando del certificado real que los usuarios reclaman. Que es independiente del nombre del súper bloque.superBlock
: Un súper bloque es la colección de desafíos del nivel superior. Cada súper bloque corresponde a una certificación en el currículo (p. ej. Diseño Web Responsivo).block
: Un bloque es una sección dentro de un súper bloque. Un bloque corresponde a un grupo de desafíos en una certificación determinada (p. ej. HTML básico y HTML5)challenge
: Un desafío es una sola lección dentro del currículo (p. ej. Di hola a los elementos HTML)
Árbol de archivos
Usando esos términos, así es como se definiría la estructura de archivos:
curriculum/
├─ _meta/
│ ├─ {block}/
│ │ ├─ meta.json
├─ {language}/
│ ├─ {superBlock}/
│ │ ├─ {block}/
│ │ │ ├─ {challenge}.md
El directorio _meta
El directorio _meta
es un directorio especial que contiene archivos .json
. Estos archivos corresponden a cada bloque en el currículo y son utilizados para determinar a qué súper bloque pertenece cada bloque y el orden de los desafíos dentro de ese bloque.
Renombrando archivos
Puede haber ocasiones en las que necesites renombrar un certificado, súper bloque, bloque o desafío. Esta sección describirá los pasos necesarios para evitar errores de compilación al hacerlo.
[!ATTENTION] Renombrar archivos dentro de la estructura del currículo puede cambiar a menudo la ruta (o URL) del contenido en la página web principal. Debe hacerse con cuidado, ya que se deben establecer redireccionamientos para cada cambio que se realice.
Renombrando una certificación
Al renombrar una certificación, es probable que desees renombrar el súper bloque asociado junto a ella. Haz lo siguiente para renombrar sólo el certificado:
- Cambia el nombre de la carpeta
curriculum/challenges/_meta/{superBlock}-certificate
por el nuevo nombre. - En el archivo
meta.json
de esa carpeta, cambia los valores enname
,dashedName
ychallengeOrder
al nuevo nombre de certificado. - En
curriculum/challenges/english/12-certificate
, cambia el nombre de la carpeta{superBlock}-certificate
y el archivo YAML dentro de ella, por el nuevo nombre. - En el archivo YAML, cambia el
title
por el nuevo nombre. - Renombra el archivo y la carpeta del paso 3 para el resto de los lenguajes del currículo.
- Actualiza
client/src/redux/index.ts
para que use eltitle
correcto. - Como alternativa, actualiza el
certSlug
para el súper bloque en el mismo archivo. Ten en cuenta que renombrar uncertSlug
cambiará el URL para las certificaciones y solo debe hacerse con consideración. - Actualiza el
title
enclient/src/resources/cert-and-project-map.ts
por el nuevo valor. Ten en cuenta que cambiar eltitle
aquí romperá la página del súper bloque asociada a la certificación. Depende del título del súper bloque en coincidir con el título de la certificación. Es probable que desees renombrar el súper bloque al mismo tiempo. - Si renombraste
certSlug
en el paso 7, cámbialo aquí para el "cert" y todos los valores deprojects
anidados. - En
config/certification-settings.js
, actualiza el valor decertTypeTitleMap
al nuevo nombre. - Si renombraste el
certSlug
en el paso 7, actualiza la clave decertSlugTypeMap
en el mismo archivo. - Actualiza el nombre del certificado en el arreglo
legacyCerts
dentro delclient/src/client-only-routes/show-project-links.tsx
si es necesario. - Actualiza el archivo principal
README.md
al nuevo nombre.
Renombrar un súper bloque
[!NOTE] Cuando renombras un súper bloque, el nuevo nombre de carpeta es usado como la ruta y debe considerarse el nombre "correcto". Todos los demás valores deben actualizarse para reflejar ese cambio.
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/english
directory. - Rename the superBlock folder in all other
curriculum/challenges/{language}
directories. - For each block within that superBlock, update the
superBlock
value in themeta.json
file 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.md
file in the above folder, changing thetitle
andsuperBlock
values to the new name. - For each block folder within the above, update the
index.md
to use the correctsuperBlock
value. - In the
client/src/resources/cert-and-project-map.ts
file, update the path for the cert at the top of the file, and thetitle
value for that superBlock. Note that changing thetitle
here 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
superBlockCertTypeMap
key inconfig/certification-settings.js
to the new superBlock name. - Update the path value in
client/src/assets/icons/index.tsx
. - For each language in
client/i18n/locales
, update theintro.json
file to use the new superBlockdashedName
. In the English file, also update thetitle
. - Check the
config/i18n/all-langs.js
file to see if the superBlock is enabled in i18n builds. Update all the values where it is used. - Update the main
README.md
file 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
_meta
directory. - Update the
name
anddashedName
property for that block'smeta.json
file. - Update the
client/utils/help-category-map.json
to use the new block name as the key. - Update the block folder in
client/src/pages/learn/{superBlock}
. - In the
index.md
file of the above folder, update theblock
value in the frontmatter. - In the
client/i18n/locales/{language}/intro.json
files, update the block name to the new name for all the languages. In the Englishintro.json
file, update thetitle
as well. - Update the main
README.md
file 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/english
directory. - Change the name of the
title
anddashedName
within that file. - Change the name of the file, and the
dashedName
in those files for all of the other language directories to match. - Update the name of the challenge in the relevant
meta.json
file. 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
title
andlink
inclient/src/resources/cert-and-project-map.ts
- If the challenge is a certificate project, update the main
README.md
file 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/dasherize.js
helper would output for the file name.