Skip to content

Commit 2c75fd8

Browse files
authored
Merge branch 'main' into menu-list-visibility
2 parents e1f9341 + 343e2cc commit 2c75fd8

File tree

1,129 files changed

+4884
-373
lines changed

Some content is hidden

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

1,129 files changed

+4884
-373
lines changed

.github/actions/translation-tracker/index.js

Lines changed: 242 additions & 186 deletions
Large diffs are not rendered by default.

.github/actions/translation-tracker/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"dependencies": {
2323
"@actions/core": "^1.10.0",
2424
"@actions/github": "^5.1.1",
25-
"@octokit/rest": "^19.0.5"
25+
"@octokit/rest": "^19.0.5",
26+
"js-yaml": "^4.1.0"
2627
}
27-
}
28+
}

.github/workflows/translation-sync.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ name: Translation Sync Tracker
22

33
on:
44
push:
5-
branches: [staging]
5+
branches: [main]
66
paths:
77
- 'src/content/examples/en/**'
8+
- 'src/content/tutorials/en/**'
89
workflow_dispatch:
910

1011
jobs:

docs/content_overview.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,73 @@
1111
- Stored in `/src/content/examples/`
1212
- All translations are stored and edited directly in this repo under the corresponding language folder in `/src/content/examples/`
1313

14+
All original examples (created new for p5.js) since 2024 are collectively attributed to p5.js Contributors under the CC-BY-NC-SA 4.0 license. However, examples that build on prior work (under a compatible license) can be attributed in more detail, to make sure that authorship is clear in citation, and code history is available to viewers.
15+
16+
To add attribution, you can use the following block in the headers, listing in **chronological** order all attribution. Below is the example from `examples/animation-and-variables-conditions/`:
17+
18+
```yaml
19+
remix:
20+
- description: Inspired by
21+
attribution:
22+
- name: Name Name
23+
URL: a-valid-link
24+
code:
25+
- label: pre-2023 code
26+
URL: a-valid-link
27+
- description: Revised by
28+
attribution:
29+
- name: Name Name
30+
URL: a-valid-link
31+
code:
32+
- label: 2023 revision code
33+
URL: a-valid-link
34+
35+
- collectivelyAttributedSince: 2024
36+
```
37+
38+
This will result in a block that lists, in order, the initial inspiration; any revision or other remix; and the collective attribution statement that begins in 2024: "From 2024 onwards, edited and maintained by p5.js Contributors and the Processing Foundation. Licensed under CC BY-NC-SA 4.0."
39+
40+
A remix can be many things ([here is an example analysis of sketch remixing (PDF)](https://dl.acm.org/doi/pdf/10.1145/3563657.3595969)); the `description` will be by default "Remixed by", so a more specific description is recommended.
41+
42+
To credit individuals, you can use the following descriptions, with `attribution.name` including the name of the author or contributor, with an optional link.
43+
44+
* Remixed by
45+
* Revised by
46+
* Created by
47+
48+
```yaml
49+
remix:
50+
- description: Created by
51+
attribution:
52+
- name: Someone
53+
URL: ...
54+
```
55+
56+
To credit a specific work that was (1) not created by the p5.js contributors since 2024 and (2) is under a compatible license, you can use the following descriptions. Here, `attribution.name` should include both the person and a specific work of theirs that was the inspiration.
57+
58+
* Inspired by
59+
* Based on
60+
61+
```yaml
62+
remix:
63+
- description: Inspired by
64+
attribution:
65+
- name: Someone's prior work
66+
URL: ...
67+
```
68+
69+
Each item in the remix history must have an at least one person listed in the attribution section. When multiple people are listed, their names will be shown **in that order**. For people, URLs are optional but recommended.
70+
71+
These attribution histories **do not need to be individually translated** for each sketch. It is enough to make sure that the descriptions (like 'Created by' and so on) appear in the different language strings in `src/content/ui/`. Then, these will be used for all examples. See [Localization](./localization.md) for more info. If you use special descriptions or names in the attribution, these do need either new strings, or localization in the respective example translations (in `src/content/examples/{language}`).
72+
73+
If the `collectivelyAttributedSince` information is missing, then no year will be included, but the collective attribution statement will still show: "Edited and maintained by p5.js Contributors and the Processing Foundation. Licensed under CC BY-NC-SA 4.0." You'll see this in examples that were part of a major revision project with specific attribution, but have collective authorship before and after. Note that the collective attribution message either does not specify a year,
74+
or specifies 2024. To add a new possible value, update:
75+
76+
1. `content/examples/config.ts` to include new permitted values;
77+
2. and `content/ui/{language}.yaml` strings for attribution to include the text
78+
79+
---
80+
1481
## Tutorials
1582

1683
- Stored in `/src/content/tutorials/`

docs/technical_overview.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ Running this will start up a local dev server and print out the address in your
2020
npm run dev
2121
```
2222

23+
### A Note About Trailing Slashes in Development
24+
25+
When testing locally with `npm run dev`, you may encounter 404 errors when navigating to pages like `/examples`, `/tutorials`, `/reference`, `/contribute`, or `/community` without a trailing slash. This is expected behavior during local development.
26+
27+
The site is configured with `trailingSlash: "always"` in `astro.config.mjs`, meaning all URLs should end with a `/`. In production on https://p5js.org, the server automatically redirects URLs to add the trailing slash, so `https://p5js.org/examples` becomes `https://p5js.org/examples/`. However, the local dev server does not handle these redirects.
28+
29+
If you see a 404 error during local development, simply add a trailing slash to the URL in your browser (e.g. change `/examples` to `/examples/`).
30+
2331
## File Organization
2432

2533
The website code is divided into a few main folders:

0 commit comments

Comments
 (0)