Skip to content

Commit

Permalink
Merge branch 'main' into Richo0110-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Richo0110 authored Sep 7, 2024
2 parents 43a174c + b67fd42 commit 105c1fb
Show file tree
Hide file tree
Showing 908 changed files with 2,850 additions and 1,827 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto-cleanup-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Create PR with only fixable issues
if: success()
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore: auto-fix Markdownlint, Prettier, and front-matter issues"
branch: markdownlint-auto-cleanup
Expand All @@ -49,7 +49,7 @@ jobs:

- name: Create PR with notice on unfixed issues
if: failure()
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore: auto-fix Markdownlint, Prettier, and front-matter issues"
branch: markdownlint-auto-cleanup
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- uses: ahmadnassri/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/interfacedata-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: node scripts/update-interface-data.js ../webref/

- name: Create pull request
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
path: mdn-content
token: ${{ secrets.AUTOMERGE_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check-lint_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: |
# Use the GitHub API to get the list of changed files
# documentation: https://docs.github.com/rest/commits/commits#compare-two-commits
DIFF_DOCUMENTS=$(gh api repos/{owner}/{repo}/compare/${{ env.BASE_SHA }}...${{ env.HEAD_SHA }} \
DIFF_DOCUMENTS=$(gh api repos/{owner}/{repo}/compare/${BASE_SHA}...${HEAD_SHA} \
--jq '.files | .[] | select(.status|IN("added", "modified", "renamed", "copied", "changed")) | .filename')
# filter out files that are not markdown
DIFF_DOCUMENTS=$(echo "${DIFF_DOCUMENTS}" | egrep -i "^files/.*\.md$" | xargs)
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
# Use the GitHub API to get the list of changed files
# documentation: https://docs.github.com/rest/commits/commits#compare-two-commits
DIFF_DOCUMENTS=$(gh api repos/{owner}/{repo}/compare/${{ env.BASE_SHA }}...${{ env.HEAD_SHA }} \
DIFF_DOCUMENTS=$(gh api repos/{owner}/{repo}/compare/${BASE_SHA}...${HEAD_SHA} \
--jq '.files | .[] | select(.status|IN("added", "modified", "renamed", "copied", "changed")) | .filename')
# filter out files that are not markdown files
Expand Down Expand Up @@ -97,27 +97,27 @@ jobs:
# you don't need that script as a writer. It's only used in CI
# and it can't use the default CONTENT_ROOT that gets set in
# package.json.
yarn build ${{ env.GIT_DIFF_CONTENT }}
yarn build $GIT_DIFF_CONTENT
echo "Disk usage size of the build"
du -sh ${{ env.BUILD_OUT_ROOT }}
du -sh $BUILD_OUT_ROOT
# Save the PR number into the build
echo ${{ github.event.number }} > ${{ env.BUILD_OUT_ROOT }}/NR
echo ${{ github.event.number }} > ${BUILD_OUT_ROOT}/NR
# Download the raw diff blob and store that inside the build
# directory.
# The purpose of this is for the PR Review Companion to later
# be able to use this raw diff file for the benefit of analyzing.
wget https://github.com/${{ github.repository }}/compare/${{ env.BASE_SHA }}...${{ env.HEAD_SHA }}.diff -O ${{ env.BUILD_OUT_ROOT }}/DIFF
wget https://github.com/${{ github.repository }}/compare/${BASE_SHA}...${HEAD_SHA}.diff -O ${BUILD_OUT_ROOT}/DIFF
- name: Merge static assets with built documents
if: ${{ env.GIT_DIFF_CONTENT }}
run: |
# Exclude the .map files, as they're used for debugging JS and CSS.
rsync -a --exclude "*.map" node_modules/@mdn/yari/client/build/ ${{ env.BUILD_OUT_ROOT }}
rsync -a --exclude "*.map" node_modules/@mdn/yari/client/build/ $BUILD_OUT_ROOT
# Show the final disk usage size of the build.
du -sh ${{ env.BUILD_OUT_ROOT }}
du -sh $BUILD_OUT_ROOT
- uses: actions/upload-artifact@v4
if: ${{ env.GIT_DIFF_CONTENT }}
Expand All @@ -128,7 +128,7 @@ jobs:
- name: Check changed files
if: ${{ env.GIT_DIFF_FILES }}
run: |
echo ${{ env.GIT_DIFF_FILES }}
echo $GIT_DIFF_FILES
export CONTENT_ROOT=$(pwd)/files
yarn filecheck ${{ env.GIT_DIFF_FILES }}
yarn filecheck $GIT_DIFF_FILES
36 changes: 22 additions & 14 deletions .github/workflows/spelling-check-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,33 @@ jobs:
npm install
echo Running spelling check...
output=$(npx cspell --no-progress --gitignore --config .vscode/cspell.json "**/*.md" || exit 0)
output=$(node scripts/linkify-logs.js "${output}")
output=$(echo "$output" | sed 's/^/- /')
echo "$output"
echo "OUTPUT<<EOF" >> $GITHUB_ENV
echo "$output" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create an issue
- name: Report spellcheck errors
if: env.OUTPUT != ''
uses: dacbd/create-issue-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Weekly spelling check
body: |
Typos and unknown words:
```
${{ env.OUTPUT }}
```
> [!TIP]
> To exclude words from the spellchecker, you can add valid words (web technology terms or abbreviations) to the [terms-abbreviations.txt](https://github.com/mdn/content/blob/main/.vscode/terms-abbreviations.txt) dictionary for IDE autocompletion. To ignore strings that are not words (`AABBCC` in code, for instance), you can add them to [ignore-list.txt](https://github.com/mdn/content/blob/main/.vscode/ignore-list.txt).
run: |
comment_body=$(cat<<EOM
Typos and unknown words:
${OUTPUT}
> [!TIP]
> To exclude words from the spellchecker, you can add valid words (web technology terms or abbreviations) to the [terms-abbreviations.txt](https://github.com/mdn/content/blob/main/.vscode/terms-abbreviations.txt) dictionary for IDE autocompletion. To ignore strings that are not words (\`AABBCC\` in code, for instance), you can add them to [ignore-list.txt](https://github.com/mdn/content/blob/main/.vscode/ignore-list.txt).
EOM
)
comment_body+=$'\n\n'$(echo "_(comment last updated: $(date +'%Y-%m-%d %H:%M:%S'))_")
gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/mdn/content/issues/35634 \
-f "state=open" \
-f "body=${comment_body}"
env:
OUTPUT: ${{ env.OUTPUT }}
GH_TOKEN: ${{ github.token }}
11 changes: 6 additions & 5 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@
/en-US/docs/CSS/transition-property /en-US/docs/Web/CSS/transition-property
/en-US/docs/CSS/transition-timing-function /en-US/docs/Web/CSS/transition-timing-function
/en-US/docs/CSS/unicode-bidi /en-US/docs/Web/CSS/unicode-bidi
/en-US/docs/CSS/uri /en-US/docs/Web/CSS/url
/en-US/docs/CSS/uri /en-US/docs/Web/CSS/url_value
/en-US/docs/CSS/used_value /en-US/docs/Web/CSS/used_value
/en-US/docs/CSS/user-ident /en-US/docs/Web/CSS/custom-ident
/en-US/docs/CSS/user-select /en-US/docs/Web/CSS/user-select
Expand Down Expand Up @@ -1085,7 +1085,7 @@
/en-US/docs/CSS:text-shadow /en-US/docs/Web/CSS/text-shadow
/en-US/docs/CSS:text-transform /en-US/docs/Web/CSS/text-transform
/en-US/docs/CSS:top /en-US/docs/Web/CSS/top
/en-US/docs/CSS:uri /en-US/docs/Web/CSS/url
/en-US/docs/CSS:uri /en-US/docs/Web/CSS/url_value
/en-US/docs/CSS:vertical-align /en-US/docs/Web/CSS/vertical-align
/en-US/docs/CSS:visibility /en-US/docs/Web/CSS/visibility
/en-US/docs/CSS:visible /en-US/docs/Web/CSS/visibility
Expand Down Expand Up @@ -11623,7 +11623,7 @@
/en-US/docs/Web/CSS/filter-function/path() /en-US/docs/Web/CSS/basic-shape/path
/en-US/docs/Web/CSS/filter-function/saturate() /en-US/docs/Web/CSS/filter-function/saturate
/en-US/docs/Web/CSS/filter-function/sepia() /en-US/docs/Web/CSS/filter-function/sepia
/en-US/docs/Web/CSS/filter-function/url /en-US/docs/Web/CSS/url
/en-US/docs/Web/CSS/filter-function/url /en-US/docs/Web/CSS/url_value
/en-US/docs/Web/CSS/fit-content() /en-US/docs/Web/CSS/fit-content_function
/en-US/docs/Web/CSS/flex-align /en-US/docs/Web/CSS/align-items
/en-US/docs/Web/CSS/flex-item-align /en-US/docs/Web/CSS/align-self
Expand Down Expand Up @@ -11737,8 +11737,9 @@
/en-US/docs/Web/CSS/transform-function/translateY() /en-US/docs/Web/CSS/transform-function/translateY
/en-US/docs/Web/CSS/transform-function/translateZ() /en-US/docs/Web/CSS/transform-function/translateZ
/en-US/docs/Web/CSS/unicode-range /en-US/docs/Web/CSS/@font-face/unicode-range
/en-US/docs/Web/CSS/uri /en-US/docs/Web/CSS/url
/en-US/docs/Web/CSS/url() /en-US/docs/Web/CSS/url
/en-US/docs/Web/CSS/uri /en-US/docs/Web/CSS/url_value
/en-US/docs/Web/CSS/url /en-US/docs/Web/CSS/url_value
/en-US/docs/Web/CSS/url() /en-US/docs/Web/CSS/url_function
/en-US/docs/Web/CSS/user-ident /en-US/docs/Web/CSS/custom-ident
/en-US/docs/Web/CSS/var() /en-US/docs/Web/CSS/var
/en-US/docs/Web/CSS/visible /en-US/docs/Web/CSS/visibility
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -90642,7 +90642,7 @@
"teoli"
]
},
"Web/CSS/url": {
"Web/CSS/url_value": {
"modified": "2020-12-11T11:18:33.507Z",
"contributors": [
"rachelandrew",
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/glossary/asynchronous/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: glossary-definition

{{GlossarySidebar}}

The term **asynchronous** refers to two or more objects or events that do not exist or happen at the same time, that is, they are **not** {{glossary("synchronous")}} . When multiple related things happen without any being dependent on the completion of previous happenings, they are asynchronous.
The term **asynchronous** refers to two or more objects or events that do not exist or happen at the same time, that is, they are **not** {{glossary("synchronous")}}. When multiple related things happen without any being dependent on the completion of previous happenings, they are asynchronous.

In computing, the word "asynchronous" is used in two major contexts, as explained below.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/glossary/constant/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page-type: glossary-definition

A **constant** is a value that the programmer cannot change, for example numbers (1, 2, 42). With {{glossary("variable","variables")}}, on the other hand, the programmer can assign a new {{glossary("value")}} to a variable name already in use.

Like variables, some constants are bound to identifiers. For example, the identifier `pi` could be bound to the value 3.14… .
Like variables, some constants are bound to identifiers. For example, the identifier `pi` could be bound to the value 3.14….

## See also

Expand Down
4 changes: 3 additions & 1 deletion files/en-us/glossary/doctype/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ page-type: glossary-definition

{{GlossarySidebar}}

In {{Glossary("HTML")}}, the **doctype** is the required "`<!DOCTYPE html>`" preamble found at the top of all documents. Its sole purpose is to prevent a {{Glossary("browser")}} from switching into so-called ["quirks mode"](/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode) when rendering a document; that is, the "`<!DOCTYPE html>`" doctype ensures that the browser makes a best-effort attempt at following the relevant specifications, rather than using a different rendering mode that is incompatible with some specifications.
In {{Glossary("HTML")}}, the **doctype** is the required `<!doctype html>` preamble found at the top of all documents. Its sole purpose is to prevent a {{Glossary("browser")}} from switching into so-called ["quirks mode"](/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode) when rendering a document; that is, the `<!doctype html>` doctype ensures that the browser makes a best-effort attempt at following the relevant specifications, rather than using a different rendering mode that is incompatible with some specifications.

The doctype is case-insensitive. The convention of MDN code examples is to use lowercase, but it's also common to write it as `<!DOCTYPE html>`.

## See also

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/glossary/etld/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ However, this does not work as a general rule, because many registrars allow org

Because this is a matter of the registrar's policies, it's impossible to tell algorithmically whether a given domain name suffix (like `ac.uk`) is publicly registrable or not. The [Public Suffix List](https://publicsuffix.org/) is a list of all suffixes under which organizations can directly register names: that is, it is a list of eTLDs.

The related concept **eTLD+1** means an eTLD plus the next part of the domain name. Because eTLDs are registrable, all domains with the same eTLD+1 are owned by the same organization.
The related concept **eTLD+1** means an eTLD plus the next part of the domain name. Because eTLD+1s are registrable, all domains with the same eTLD+1 are owned by the same organization.

For example, all the following are eTLD+1 domains:

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/glossary/https_rr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Further, the presence of an _HTTPS RR_ signals that all useful {{Glossary("HTTP"

### See also

- [Service binding and parameter specification via the DNS (DNS SVCB and HTTPS RRs)](https://datatracker.ietf.org/doc/draft-ietf-dnsop-svcb-https/00/) (Draft IETF specification: draft-ietf-dnsop-svcb-https-00)
- {{RFC(9460, "Service Binding and Parameter Specification via the DNS (SVCB and HTTPS Resource Records)")}}
- [Strict Transport Security vs. HTTPS Resource Records: the showdown](https://emilymstark.com/2020/10/24/strict-transport-security-vs-https-resource-records-the-showdown.html) (Emily M. Stark blog)
- Related glossary terms:
- {{glossary("TLS")}}
2 changes: 1 addition & 1 deletion files/en-us/glossary/slug/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page-type: glossary-definition

A Slug is the unique identifying part of a web address, typically at the end of the URL. In the context of MDN, it is the portion of the URL following "_\<locale>/docs/_".

It may also just be the final component when a new document is created under a parent document; for example, this page's slug is `Glossary/Slug` .
It may also just be the final component when a new document is created under a parent document; for example, this page's slug is `Glossary/Slug`.

## See also

Expand Down
22 changes: 22 additions & 0 deletions files/en-us/glossary/ssg/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Static site generator (SSG)
slug: Glossary/SSG
page-type: glossary-definition
---

{{GlossarySidebar}}

A **static site generator** (SSG) is a software used to generate _static_ websites. A static website is comprised of {{glossary("HTML")}}, {{glossary("CSS")}}, and {{glossary("JavaScript")}} files. Most importantly static sites do not have [server-side logic](/en-US/docs/Learn/Server-side), so for any given URL, all users will receive the same content. Authors write content in any form accepted by the generator, such as Markdown, reStructuredText, HTML, (and sometimes even [React](/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/React_getting_started), and so on), and the generator compiles them into a set of optimized static files that can be rendered by the browser.

Static sites are commonly used for blogs, documentation, and other content-driven websites, which don't have data that needs to be fetched or generated server-side. They are fast, secure, and easy to deploy, because they can be served from a {{glossary("CDN")}}.

## See also

- [Introduction to client-side frameworks > static site generators](/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/Introduction#static_site_generators)
- [Static site generator](https://en.wikipedia.org/wiki/Static_site_generator) on Wikipedia
- [Wordpress](https://wordpress.com/)
- [Docusaurus](https://docusaurus.io/)
- [Jekyll](https://jekyllrb.com/)
- [Astro](https://astro.build/)
- [VitePress](https://vitepress.dev/)
- [Eleventy](https://www.11ty.dev/)
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,23 @@ To use the module:
Another way to achieve this is to use Python's `http.server` module.

> [!NOTE]
> Older versions of Python (up to version 2.7) provided a similar module named `SimpleHTTPServer`. If you are using Python 2.x, you can follow this guide by replacing all uses of `http.server` with `SimpleHTTPServer`. However, we recommend you use the latest version of Python.
> Older versions of Python (up to version 2.7) provided a similar module named `SimpleHTTPServer`. Python 2 is already end-of-life so we recommend using Python 3.
To do this:

1. Install Python. If you are using Linux or macOS, it should be available on your system already. If you are a Windows user, you can get an installer from the Python homepage and follow the instructions to install it:

- Go to [python.org](https://www.python.org/)
- Under the Download section, click the link for Python "3.xxx".
- At the bottom of the page, click the _Windows Installer_ link to download the installer file.
- When it has downloaded, run it.
- On the first installer page, make sure you check the "Add Python 3.xxx to PATH" checkbox.
- Click _Install_, then click _Close_ when the installation has finished.

2. Open your command prompt (Windows) / terminal (macOS/ Linux). To check if Python is installed, enter the following command:
1. Run the following command to check if Python is already installed:

```bash
python -V
# If the above fails, try:
python3 -V
# Or, if the "py" command is available, try:
py -V
py -3 -V
```

3. This should return a version number. If this is OK, navigate to the directory that contains the website code you want to test, using the `cd` command.
2. If Python is not installed, you need to install it. Follow the [download instructions](https://www.python.org/downloads/) in the Python docs (we also have more detailed explanations in our [Django tutorial](/en-US/docs/Learn/Server-side/Django/development_environment#installing_python_3)), then run the above commands again to check if the installation is successful.

3. If Python is set up, navigate to the directory that contains the website code you want to test, using the `cd` command.

```bash
# include the directory name to enter it, for example
Expand All @@ -120,17 +113,14 @@ To do this:
4. Enter the command to start up the server in that directory:

```bash
# If Python version returned above is 3.X
# On Windows, try "python -m http.server" or "py -3 -m http.server"
python3 -m http.server
# If Python version returned above is 2.X
python -m SimpleHTTPServer
```

5. By default, this will run the contents of the directory on a local web server, on port 8000. You can go to this server by going to the URL `localhost:8000` in your web browser. Here you'll see the contents of the directory listed — click the HTML file you want to run.

> [!NOTE]
> If you already have something running on port 8000, you can choose another port by running the server command followed by an alternative port number, e.g. `python3 -m http.server 7800` (Python 3.x) or `python -m SimpleHTTPServer 7800` (Python 2.x). You can then access your content at `localhost:7800`.
> If you already have something running on port 8000, you can choose another port by running the server command followed by an alternative port number, e.g. `python3 -m http.server 7800`. You can then access your content at `localhost:7800`.
## Running server-side languages locally

Expand Down
Loading

0 comments on commit 105c1fb

Please sign in to comment.