Skip to content

Commit 28f2dab

Browse files
committed
Merge branch '2.0' into nb-strands-tut-both-simplifications
2 parents 605a9f6 + e4f5332 commit 28f2dab

295 files changed

Lines changed: 8885 additions & 3594 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/beta_deploy.yml

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy beta to Netlify
1+
name: Deploy beta to Cloudflare
22

33
on:
44
# Trigger the workflow every time you push to the `main` branch
@@ -18,25 +18,18 @@ jobs:
1818
build-deploy:
1919
runs-on: ubuntu-latest
2020
steps:
21-
21+
- uses: actions/setup-node@v6.3.0
22+
with:
23+
node-version: 22.22.x
2224
- name: Checkout your repository using git
2325
uses: actions/checkout@v4
24-
25-
- name: Install, build, and upload your site output
26-
env:
27-
NODE_OPTIONS: "--max_old_space_size=4096"
28-
uses: withastro/action@v2
29-
30-
- name: Deploy to Netlify
31-
uses: nwtgck/actions-netlify@v3.0
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Build website
29+
run: npm run build
30+
- name: Deploy to Cloudflare Workers
31+
uses: cloudflare/wrangler-action@v3
3232
with:
33-
publish-dir: './dist'
34-
production-branch: "2.0"
35-
github-token: ${{ secrets.GITHUB_TOKEN }}
36-
deploy-message: "Deploy from GitHub Actions"
37-
enable-pull-request-comment: false
38-
enable-commit-comment: false
39-
overwrites-pull-request-comment: false
40-
env:
41-
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
42-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
33+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
34+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
35+
environment: beta

.github/workflows/deploy.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,20 @@ permissions:
1515
id-token: write
1616

1717
jobs:
18-
build:
18+
build-deploy:
1919
runs-on: ubuntu-latest
2020
steps:
21+
- uses: actions/setup-node@v6.3.0
22+
with:
23+
node-version: 22.22.x
2124
- name: Checkout your repository using git
2225
uses: actions/checkout@v4
23-
- name: Install, build, and upload your site output
24-
env:
25-
NODE_OPTIONS: "--max_old_space_size=4096"
26-
uses: withastro/action@v2
27-
28-
deploy:
29-
needs: build
30-
runs-on: ubuntu-latest
31-
environment:
32-
name: github-pages
33-
url: ${{ steps.deployment.outputs.page_url }}
34-
steps:
35-
- name: Deploy to GitHub Pages
36-
id: deployment
37-
uses: actions/deploy-pages@v4
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Build website
29+
run: npm run build
30+
- name: Deploy to Cloudflare Workers
31+
uses: cloudflare/wrangler-action@v3
32+
with:
33+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
34+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

.github/workflows/test.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
steps:
1313
- name: Checkout your repository using git
1414
uses: actions/checkout@v4
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '22'
1519
- name: Install dependencies
1620
run: npm ci
1721
- name: Test
@@ -21,6 +25,10 @@ jobs:
2125
steps:
2226
- name: Checkout your repository using git
2327
uses: actions/checkout@v4
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '22'
2432
- name: Install dependencies
2533
run: npm ci
2634
- name: Lint
@@ -30,6 +38,10 @@ jobs:
3038
steps:
3139
- name: Checkout your repository using git
3240
uses: actions/checkout@v4
41+
- name: Setup Node.js
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: '22'
3345
- name: Install dependencies
3446
run: npm ci
3547
- name: Typecheck
@@ -39,6 +51,10 @@ jobs:
3951
steps:
4052
- name: Checkout your repository using git
4153
uses: actions/checkout@v4
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: '22'
4258
- name: Install dependencies
4359
run: npm ci
4460
- name: Build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ translator/
2929
public/p5.min.js
3030

3131
# optional local preferences for vscode
32-
local.code-workspace
32+
local.code-workspace
33+
.zed

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Force npm to fail (not just warn) if the node.js version in "engines" isn't met
2+
engine-strict=true

docs/technical_overview.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Setup
66

7-
1. Make sure you have [node and npm installed on your machine](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs).
7+
1. Make sure you have [node (at least version 22) and npm installed on your machine](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs).
88
2. Clone this repo by typing git clone https://github.com/processing/p5.js-website/ in your terminal. (You can also use [GitHub Desktop](https://desktop.github.com/)).
99
3. Then install the project's dependencies with:
1010

@@ -68,3 +68,8 @@ And then view it locally with
6868
```shellsession
6969
npm run preview
7070
```
71+
72+
73+
## Previewing the p5.js reference for work-in-progress
74+
75+
If you're developing the p5.js library and want to preview your documentation, there are some specific notes at ["Generating and previewing the reference"](https://beta.p5js.org/contribute/contributing_to_the_p5js_reference/#generating-and-previewing-the-reference).

docs/url_conventions.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# URL conventions
2+
3+
## Trailing slash in URLs
4+
5+
All URLs for resources on the website should end with a slash character (`/`).
6+
7+
For example, the correct URL for the reference page about the `circle` function is
8+
* good: https://beta.p5js.org/reference/p5/circle/
9+
* bad: https://beta.p5js.org/reference/p5/circle
10+
11+
More correctly, it should come at the end of the _path_ part of the URL.
12+
13+
If a query string or hash/fragment is present in the URL, the trailing slash should come before those, as shown in these examples:
14+
15+
Example with a query string
16+
* good: https://beta.p5js.org/search/?term=colorMode
17+
* bad: https://beta.p5js.org/search?term=colorMode/
18+
* bad: https://beta.p5js.org/search?term=colorMode
19+
20+
Example with a hash / fragment part
21+
* good: https://beta.p5js.org/contribute/documentation_style_guide/#comments
22+
* bad: https://beta.p5js.org/contribute/documentation_style_guide#comments/
23+
24+
#### Other correct examples
25+
* https://beta.p5js.org/download/
26+
* https://beta.p5js.org/reference/
27+
* https://beta.p5js.org/tutorials/
28+
* https://beta.p5js.org/examples/
29+
* https://beta.p5js.org/tutorials/get-started/
30+
* https://beta.p5js.org/examples/shapes-and-color-shape-primitives/
31+
* https://beta.p5js.org/
32+
33+
### Automatic trailing slash addition
34+
While the production webserver _may_ add a trailing slash to a requested URL when it is missing, but this should not be relied upon.
35+
Instead write (or generate) links that follow the rules above.
36+
37+
## Case in URLs
38+
39+
URL casing is somewhat inconsistent across the website. Guidelines for new resources:
40+
41+
* Prefer lower-case
42+
* Spaces should not be used in URLs.
43+
* In place of spaces, dashes (`-`) should ideally be used in preference to underscores (`_`).
44+
* First, however, follow established local conventions used by other resources of the same type
45+
* e.g. all contributor docs use underscores "like_this"
46+
47+
#### Examples of kebab-case URL:
48+
* https://beta.p5js.org/tutorials/variables-and-change/
49+
* https://beta.p5js.org/examples/3d-orbit-control/
50+
* https://beta.p5js.org/code-of-conduct/
51+
52+
### A case exception: reference pages
53+
54+
In reference pages, the URLs follow the names of the functions, classes, and variables. So, they include some capitals and use "camel-case" e.g. `createCanvas`.
55+
56+
#### Examples of reference page URLs
57+
* https://p5js.org/reference/p5.Vector/fromAngle/
58+
* https://beta.p5js.org/reference/p5/p5.Image/
59+
60+
More on reference page URLs can be found in https://beta.p5js.org/contribute/contributing_to_the_p5js_reference/#linking

0 commit comments

Comments
 (0)