Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion src/content/docs/how-to-help-with-video-challenges.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,41 @@ A video challenge is a small section of a full-length video course on a particul

The video challenge pages are created by members of the freeCodeCamp team. YouTube videos are also uploaded by members of the freeCodeCamp team.

## Numbering Challenges

:::note
This section only applies to the catalog items which don't use the existing scripts for generating files with MongoDB ids.
:::
Comment on lines +13 to +15
Copy link
Contributor

@majestic-owl448 majestic-owl448 Mar 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use the *-challenge scripts, now that they are updated they work with generating files that have the usual id.md naming pattern, freeCodeCamp/freeCodeCamp#66354

if needed the template they use can be updated more


Every challenge needs an `id`. If you don't specify one, then MongoDB will create a new random one when it saves the data; however, we don't want it to do that, since we want the challenge ids to be consistent across different environments (staging, production, lots of different developers, etc.).

To generate a new one in a shell (assuming MongoDB is running separately):

1. Run `mongo` command.
2. Run `ObjectId()` command.

For example:

```bash
$ mongo
MongoDB shell version v3.6.1
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.10
...
$ ObjectId()
ObjectId("5a474d78df58bafeb3535d34")
```

The result is a new id, for example, `5a474d78df58bafeb3535d34` above.

Once you have your id, put it into the markdown file as the `id` field at the top, e.g.

```yml
---
id: 5a474d78df58bafeb3535d34
title: Challenge Title
```

## Challenge Template

Below is a template of what the challenge markdown files look like.
Expand All @@ -20,7 +55,6 @@ sidebar:
label: Work on Video Challenges
challengeType: 11
videoId: 'YouTube videoId for video challenge'
forumTopicId: 12345
---

# --description--
Expand Down
Loading