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
6 changes: 3 additions & 3 deletions .github/workflows/auto-cleanup-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Create PR with only fixable issues
if: success()
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
commit-message: "chore: auto-fix Markdownlint, Prettier, and front-matter issues"
branch: markdownlint-auto-cleanup
Expand All @@ -61,7 +61,7 @@ jobs:

- name: Create PR with notice on unfixed issues
if: failure()
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
commit-message: "chore: auto-fix Markdownlint, Prettier, and front-matter issues"
branch: markdownlint-auto-cleanup
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/interfacedata-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout content
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: mdn-content
ref: main
Expand All @@ -29,7 +29,7 @@ jobs:
package-manager-cache: false

- name: Checkout webref
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: w3c/webref
path: webref
Expand All @@ -41,7 +41,7 @@ jobs:
run: node scripts/update-interface-data.js ../webref/

- name: Create pull request
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
path: mdn-content
token: ${{ secrets.AUTOMERGE_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-check-lint_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout BASE
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:

- name: Checkout HEAD
if: steps.check.outputs.HAS_FILES == 'true'
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: pr_head
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_cspell_lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout-cone-mode: false
sparse-checkout: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-check_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand All @@ -101,7 +101,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand All @@ -126,7 +126,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_url-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-review-companion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
process_gcloudignore: false

- name: Checkout (mdn/content)
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: steps.check.outputs.HAS_ARTIFACT
with:
path: content
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
BUILD_OUT_ROOT: build

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spelling-check-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
timeout-minutes: 5

steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ The general step-by-step process for creating a page would be:
cd ~/repos/mdn/content
git checkout main
git pull mdn main
# Run "yarn" again to ensure you've
# installed the latest Yari dependency.
yarn
# Run "npm install" to ensure dependencies are up to date.
npm install
git checkout -b my-add
```

Expand All @@ -52,7 +51,7 @@ Moving one or more documents or an entire tree of documents is easy
because we've created a special command that takes care of the details for you:

```bash
yarn content move <from-slug> <to-slug> [locale]
npm run content move <from-slug> <to-slug> [locale]
```

You just have to specify the slug of the existing document that you'd like
Expand All @@ -61,7 +60,7 @@ location (e.g., `Web/HTTP/Guides/Auth`), optionally followed by the locale of th
existing document (defaults to `en-US`).

If the existing document that you'd like to move has child documents (i.e.,
it represents a document tree), the `yarn content move` command will move
it represents a document tree), the `npm run content move` command will move
the entire tree.

For example, let's say you want to move the entire
Expand All @@ -73,16 +72,15 @@ For example, let's say you want to move the entire
cd ~/repos/mdn/content
git checkout main
git pull mdn main
# Run "yarn" again just to ensure you've
# installed the latest Yari dependency.
yarn
# Run "npm install" again to ensure dependencies are up to date.
npm install
git checkout -b my-move
```

2. Perform the move (which will delete and modify existing files as well as create new files).

```bash
yarn content move Web/HTTP/Guides/Authentication Web/HTTP/Guides/Auth
npm run content move Web/HTTP/Guides/Authentication Web/HTTP/Guides/Auth
```

3. Once files are moved we need to update references to those files in the other content files as well. Use following command to update all the references automatically in one go:
Expand All @@ -102,21 +100,22 @@ For example, let's say you want to move the entire
5. Create your pull request.

> [!NOTE]
> The `yarn content move` command adds required redirects in the `_redirects.txt` file so that the old location will redirect to the new one. Don't edit the `_redirects.txt` file manually! Mistakes can easily creep in if you do. If you need to add a redirect without moving a file, talk to the MDN Web Docs team on the [MDN Web Docs Communication channels](/en-US/docs/MDN/Community/Communication_channels) about it.
> The `npm run content move` command adds required redirects in the `_redirects.txt` file so that the old location will redirect to the new one. Don't edit the `_redirects.txt` file manually! Mistakes can easily creep in if you do. If you need to add a redirect without moving a file, talk to the MDN Web Docs team on the [MDN Web Docs Communication channels](/en-US/docs/MDN/Community/Communication_channels) about it.

## Deleting pages

Documents should only be removed from MDN Web Docs under special circumstances. If you are thinking about deleting pages, please discuss it with the MDN Web Docs team on the [MDN Web Docs chat rooms](/en-US/docs/MDN/Community/Communication_channels#chat_rooms) first.

Deleting one or more documents or an entire tree of documents is easy, just like moving pages, because we've created a special command that takes care of the
details for you:
Deleting one or more documents or an entire tree of documents is easy, just like moving pages, because we've created a special command that takes care of the details for you:

```bash
yarn content delete <document-slug> [locale]
npm run content delete <document-slug> [locale] -- --redirect <redirect-slug-or-url>
```

When you redirect, the target page can be an external URL or another page on MDN Web Docs.

> [!NOTE]
> You need to use the `yarn content delete` command to delete pages from MDN Web Docs. Don't just delete their directories from the repo. The `yarn content delete` command also handles other necessary changes such as updating the `_wikihistory.json` file.
> You need to use the `npm run content delete` command to delete pages from MDN Web Docs. Don't just delete their directories from the repo. The `npm run content delete` command also handles other necessary changes such as updating the `_wikihistory.json` file.

You just have to specify the slug of the existing document that you'd like
to delete (e.g., `Web/HTTP/Guides/Authentication`), optionally followed by the locale
Expand All @@ -135,38 +134,31 @@ entire `/en-US/Web/HTTP/Guides/Authentication` tree, you'd perform the following
cd ~/repos/mdn/content
git checkout main
git pull mdn main
# Run "yarn" again just to ensure you've
# installed the latest Yari dependency.
yarn
# Run "npm install" again to ensure dependencies are up to date.
npm install
git checkout -b my-delete
```

2. Perform the delete.
2. Perform the delete with a redirect.

```bash
yarn content delete Web/HTTP/Guides/Authentication --recursive
npm run content delete Web/HTTP/Guides/Authentication --recursive -- --redirect /en-US/path/of/target/page
```

3. Add a redirect. The target page can be an external URL or another page on MDN Web Docs.

```bash
yarn content add-redirect /en-US/path/of/deleted/page /en-US/path/of/target/page
```

4. Add and commit all the deleted files as well as push your branch to your fork.
3. Add and commit all the deleted files as well as push your branch to your fork.

```bash
git commit -a
git push -u origin my-delete
```

5. Create your pull request.
4. Create your pull request.

> [!NOTE]
> If the slug of the page you wish to delete contains special characters, include it in quotes, like so:
>
> ```bash
> yarn content delete "Mozilla/Add-ons/WebExtensions/Debugging_(before_Firefox_50)"
> npm run content delete "Mozilla/Add-ons/WebExtensions/Debugging_(before_Firefox_50)" -- --redirect <redirect-slug-or-url>
> ```

Removing content from MDN Web Docs will inevitably result in updating the existing content as well. As a lot of articles link to others, the removed content will likely be referenced elsewhere. Adding the redirect will mitigate the impact of removing content; however, it's best practice to edit content to reflect the change and include the content edits along with the removal pull request.
Expand All @@ -177,7 +169,7 @@ To edit a page, you need to find the page source in our [content](https://github

### Preview changes

If you are editing the page locally, to see what your changes look like you can go to the content repo folder, execute the CLI command `yarn start`, go to `localhost:5042` in your browser, and navigate to the page and view it. Enter the title in the search box to find it easily. The previewed page will update in the browser as you edit the source.
If you are editing the page locally, to see what your changes look like you can go to the content repo folder, execute the CLI command `npm start`, go to `localhost:5042` in your browser, and navigate to the page and view it. Enter the title in the search box to find it easily. The previewed page will update in the browser as you edit the source.

### Attach files

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Let's walk through an example:
cd ~/path/to/mdn/content
git checkout main
git pull mdn main
# Run "yarn" to make sure dependencies are up-to-date
yarn
# Run "npm install" to make sure dependencies are up-to-date
npm install
git checkout -b my-images
```

Expand All @@ -58,7 +58,7 @@ Let's walk through an example:
For more details, see the [Compressing images](#compressing_images) section.

```bash
yarn filecheck files/en-us/web/css/my-cool-image.png
npm run filecheck files/en-us/web/css/my-cool-image.png
```

4. Reference your image in the document using the Markdown syntax for images, providing [descriptive text for the `alt` attribute](/en-US/docs/Learn_web_development/Core/Accessibility/HTML#text_alternatives) between the brackets that describe the image, or include an {{htmlelement("img")}} element with `alt` attribute inside `files/en-us/web/css/index.md`:
Expand Down Expand Up @@ -126,7 +126,7 @@ This option compresses the image as much as possible and replaces the original w
For example:

```bash
yarn filecheck files/en-us/web/css/my-cool-image.png --save-compression
npm run filecheck files/en-us/web/css/my-cool-image.png --save-compression
```

## Adding videos to MDN pages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ Most of them are created using a system that defines data structures in YAML fil
In this guide, you will learn how these sidebars work so you can edit existing sidebars and create new ones as required.

> [!NOTE]
> If you're editing sidebars, you can use `yarn tool` commands for formatting and syncing with redirects.
> See [Yari's CLI Tool](https://github.com/mdn/yari/blob/main/docs/cli-tool.md) documentation for information.
> If you're editing sidebars, you can use `npm run content` commands:
>
> - Run `npm run content -- fmt-sidebars` to format sidebars.
> - Run `npm run content -- sync-sidebars` to sync with redirects.

## How sidebars work

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ Do not use variant spelling.
We have [cSpell](https://cspell.org/) installed to catch spelling errors. It runs every week and generates [a report of spelling errors](https://github.com/mdn/content/issues?q=Weekly+spelling+check+is%3Aissue+in%3Atitle) in the repository. You can also run it locally using the following command:

```bash
yarn lint:typos
npm run lint:typos
```

In the repository, we maintain several word lists, located at [`.vscode/dictionaries`](https://github.com/mdn/content/tree/main/.vscode/dictionaries), that contain sanctioned words not in the default dictionaries. You can add more words to these lists if they are valid but reported by the spell checker. Read [`.vscode/cspell.json`](https://github.com/mdn/content/blob/main/.vscode/cspell.json) to understand what each dictionary contains and the details of our spell-checking configuration.
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/mozilla/firefox/releases/147/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ No notable changes.

### JavaScript

- CSS module scripts are now supported, allowing a stylesheet to be loaded into a script as a {{domxref("CSSStyleSheet")}} instance using the [`import`](/en-US/docs/Web/JavaScript/Reference/Statements/import) keyword and the [`type` import attribute](/en-US/docs/Web/JavaScript/Reference/Statements/import/with) set to `type="css"`.
- CSS module scripts are now supported, allowing a stylesheet to be loaded into a script as a {{domxref("CSSStyleSheet")}} instance using the [`import`](/en-US/docs/Web/JavaScript/Reference/Statements/import) keyword and the `type` [import attribute](/en-US/docs/Web/JavaScript/Reference/Statements/import/with) set to [`type="css"`](/en-US/docs/Web/JavaScript/Reference/Statements/import/with#css_modules_type_css).
([Firefox bug 1986681](https://bugzil.la/1986681)).
- The {{jsxref("Iterator.concat()")}} method is now supported. This method enables you to create a new iterator that combines multiple input iterables into a single sequence.
([Firefox bug 1986672](https://bugzil.la/1986672)).
Expand Down
Loading