Skip to content

Commit ca5b06a

Browse files
authored
Merge branch 'main' into add-donate-page-zh
2 parents 05bb57e + 0371863 commit ca5b06a

File tree

19 files changed

+138
-38
lines changed

19 files changed

+138
-38
lines changed

.github/workflows/beta_deploy.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy beta to Netlify
2+
3+
on:
4+
# Trigger the workflow every time you push to the `main` branch
5+
# Using a different branch name? Replace `main` with your branch’s name
6+
push:
7+
branches: ["2.0"]
8+
# Allows you to run this workflow manually from the Actions tab on GitHub.
9+
workflow_dispatch:
10+
11+
# Allow this job to clone the repo and create a page deployment
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
build-deploy:
19+
runs-on: ubuntu-latest
20+
steps:
21+
22+
- name: Checkout your repository using git
23+
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/[email protected]
32+
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 }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you are here to edit or translate content, please do so inside [the `src/cont
1212
For making code changes, please check out the [technical overview](./docs/technical_overview.md) to get started.
1313

1414
### Adding Libraries
15-
Follow the steps in the <a href="./docs/contributing_libraries.md">Contributing Libraries</a> doc if you would like to add your libary to the collection!
15+
Follow the steps in the <a href="./docs/contributing_libraries.md">Contributing Libraries</a> doc if you would like to add your library to the collection!
1616

1717
## Add Yourself to p5.js Contributors
1818
We recognize all types of contributions. This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Add yourself to the [p5.js repository readme](https://github.com/processing/p5.js/blob/main/README.md#contributors) by following the [instructions here](https://github.com/processing/p5.js/issues/2309)!

astro.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export default defineConfig({
6363
},
6464
},
6565
vite: {
66+
optimizeDeps: {
67+
exclude: ["@swc/html"]
68+
},
6669
rollupOptions: {
6770
external: ["/src/scripts/*"],
6871
},

docs/contributing_libraries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ p5.js welcomes libraries contributed by others! <a href="https://github.com/proc
1919
4. Add a **high-res colored image of 1500x1000px** of your library into `src/content/libraries/images`
2020
5. Submit a pull request and we'll review your submission
2121

22-
We add libraries that are open-source, includes some documentation and examples, and <a href="https://github.com/processing/p5.js/blob/main/CODE_OF_CONDUCT.md">follow our code of conduct.</a> This directory targets beginner users, so we aim to ensure users have a smooth experience getting started with any library linked to.
22+
We add libraries that are open-source, include some documentation and examples, and <a href="https://github.com/processing/p5.js/blob/main/CODE_OF_CONDUCT.md">follow our code of conduct.</a> This directory targets beginner users, so we aim to ensure users have a smooth experience getting started with any library linked to.
2323

2424
If you have any questions, feel free to open an issue or create a work-in-progress PR and ask us anything!

docs/localization.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Localization Architecture
22

3-
An important feature of the p5.js website is support multiple languages (four and counting!). This requires the website to build and serve every page in each of the supported languages.
3+
An important feature of the p5.js website is its support for multiple languages (four and counting!). This requires the website to build and serve every page in each of the supported languages.
44

55
Our website framework Astro has localization support, but it doesn't cover our full set of needs so the localization tooling in this repo is largely [hand rolled](https://www.quora.com/Computer-Science-Where-did-the-phrase-Roll-your-own-come-from-and-why-is-it-used-in-CS).
66

@@ -29,7 +29,7 @@ Taking the tutorials page as an example:
2929

3030
Both of these routes use the [TutorialsLayout](/src/layouts/TutorialsLayout.astro) to render the page by passing in the content in the correct language.
3131

32-
The main difference between these two routing files is how they retrieve the correct translation. The English version retreives the English version of the content. The other translations retrieve their version of the content and then fill in any gaps with English versions. See `getCollectionInLocaleWithFallbacks()` for how this works.
32+
The main difference between these two routing files is how they retrieve the correct translation. The English version retrieves the English version of the content. The other translations retrieve their version of the content and then fill in any gaps with English versions. See `getCollectionInLocaleWithFallbacks()` for how this works.
3333

3434
Because of this subtle duplication, we try to keep the files in `src/pages/` as short as possible and move rendering logic into the [layout files](/src/layouts/).
3535

@@ -89,7 +89,7 @@ const uiTranslations = await getUiTranslationWithFallback(currentLocale);
8989
9090
```
9191

92-
And then in the HelloButton Preact component, we acess the translations using object keys:
92+
And then in the HelloButton Preact component, we access the translations using object keys:
9393

9494
```jsx
9595
export const HelloButton = (props) => {
@@ -98,7 +98,7 @@ export const HelloButton = (props) => {
9898
};
9999
```
100100

101-
Essentially, the arguments you would pass to `t` in the first example for astro files are the same you would pass as keys to the `uiTranslations` object. If its a nested key, that looks like:
101+
Essentially, the arguments you would pass to `t` in the first example for astro files are the same you would pass as keys to the `uiTranslations` object. If it's a nested key, that looks like:
102102

103103
```jsx
104104
uiTranslations["sectionTitles"]["main"];

docs/styles_architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ There are a few ways you can write CSS in this project:
66

77
### 1. Use [Tailwind](https://tailwindcss.com/) css classes directly within layouts and components
88

9-
This is often the fastest way to add custom styles if you are familair with [Tailwind](https://tailwindcss.com/). See a good example in `/src/p5/p5.js-website/src/components/Footer/index.astro`.
9+
This is often the fastest way to add custom styles if you are familiar with [Tailwind](https://tailwindcss.com/). See a good example in `/src/p5/p5.js-website/src/components/Footer/index.astro`.
1010

1111
### 2. Write styles in the [SCSS](https://sass-lang.com/) files in `/styles` and use those classes in layouts and components
1212

@@ -18,7 +18,7 @@ This can be useful for situations where the styling you need for a particular ar
1818

1919
#### 4. Write css in a style tag within an `.astro` file
2020

21-
This can be a good approach when you need a few custom styles for a single a layout or component but adding an extra SCSS feels like overkill. See an example in `/src/layouts/AboutLayout.astro`
21+
This can be a good approach when you need a few custom styles for a single layout or component but adding an extra SCSS feels like overkill. See an example in `/src/layouts/AboutLayout.astro`
2222

2323
## Useful Global Styles
2424

public/assets/animals.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<animals>
3+
<mammal id="0" species="Capra hircus">Goat</mammal>
4+
<mammal id="1" species="Panthera pardus">Leopard</mammal>
5+
<mammal id="2" species="Equus zebra">Zebra</mammal>
6+
<reptile id="3" species="Caretta caretta">Turtle</reptile>
7+
</animals>

public/assets/data.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"x": 50,
3+
"y": 50,
4+
"d": 40,
5+
"color": "deeppink",
6+
"bubbles": [
7+
{ "x": 73, "y": 70.1, "d": 17.1 },
8+
{ "x": 68.3, "y": 71.8, "d": 24.3 },
9+
{ "x": 2.1, "y": 76.6, "d": 23.6 },
10+
{ "x": 74.5, "y": 8.5, "d": 21.5 },
11+
{ "x": 80.4, "y": 80.3, "d": 8.1 },
12+
{ "x": 1.5, "y": 62.4, "d": 33.9 },
13+
{ "x": 48, "y": 14.6, "d": 32.5 },
14+
{ "x": 46.7, "y": 13.1, "d": 37.2 },
15+
{ "x": 95.4, "y": 73.3, "d": 5.7 },
16+
{ "x": 23.6, "y": 75.1, "d": 36.9 },
17+
{ "x": 82.6, "y": 2.9, "d": 16.6 },
18+
{ "x": 82.5, "y": 99.1, "d": 4 },
19+
{ "x": 44, "y": 0.7, "d": 5.9 },
20+
{ "x": 86.4, "y": 65.9, "d": 38.6 },
21+
{ "x": 45.3, "y": 24.9, "d": 9.4 },
22+
{ "x": 64.4, "y": 84, "d": 26.7 },
23+
{ "x": 51.4, "y": 55.1, "d": 23.4 },
24+
{ "x": 83.2, "y": 96.4, "d": 33.5 },
25+
{ "x": 52.2, "y": 67.7, "d": 5.9 },
26+
{ "x": 75, "y": 85.1, "d": 6.1 }
27+
]
28+
}

src/components/Footer/index.astro

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ const bannerEntry = await getEntry("banner", currentLocale);
2626
<div>
2727
<div class="mb-5" id="resources-footer-category">{t("Resources")}</div>
2828
<ul aria-labelledby="resources-footer-category">
29-
<li><a href="/reference">{t("Reference")}</a></li>
30-
<li><a href="/tutorials">{t("Tutorials")}</a></li>
31-
<li><a href="/examples">{t("Examples")}</a></li>
32-
<li><a href="/contribute">{t("Contribute")}</a></li>
33-
<li><a href="/community">{t("Community")}</a></li>
34-
<li><a href="/about">{t("About")}</a></li>
29+
<li><a href="/reference/">{t("Reference")}</a></li>
30+
<li><a href="/tutorials/">{t("Tutorials")}</a></li>
31+
<li><a href="/examples/">{t("Examples")}</a></li>
32+
<li><a href="/contribute/">{t("Contribute")}</a></li>
33+
<li><a href="/community/">{t("Community")}</a></li>
34+
<li><a href="/about/">{t("About")}</a></li>
3535
<li><a href="https://editor.p5js.org">{t("Start Coding")}</a></li>
36-
<li><a href="/donate">{t("Donate")}</a></li>
36+
<li><a href="/donate/">{t("Donate")}</a></li>
3737
</ul>
3838
</div>
3939
<div class="lg:col-span-2 grid grid-cols-subgrid">
4040
<div>
4141
<div class="mb-5" id="info-footer-category">{t("Information")}</div>
4242
<ul aria-labelledby="info-footer-category">
43-
<li><a href="/download">{t("Download")}</a></li>
44-
<li><a href="/contact">{t("Contact")}</a></li>
45-
<li><a href="/copyright">{t("Copyright")}</a></li>
46-
<li><a href="/privacy-policy">{t("Privacy Policy")}</a></li>
47-
<li><a href="/terms-of-use">{t("Terms of Use")}</a></li>
43+
<li><a href="/download/">{t("Download")}</a></li>
44+
<li><a href="/contact/">{t("Contact")}</a></li>
45+
<li><a href="/copyright/">{t("Copyright")}</a></li>
46+
<li><a href="/privacy-policy/">{t("Privacy Policy")}</a></li>
47+
<li><a href="/terms-of-use/">{t("Terms of Use")}</a></li>
4848
</ul>
4949
</div>
5050
<div class="lg:col-start-2 mt-xl lg:mt-0">

src/content/contributor-docs/en/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Head over to [this link](../contributor_guidelines/) where you will be guided on
5959

6060
Most of the time we will stick with this workflow quite strictly and, especially if you have contributed to other projects before, it may feel like there are too many hoops to jump through for what may be a simple contribution. However, the steps above are aimed to make it easy for you as a contributor and for stewards/maintainers to contribute meaningfully, while also making sure that you won't be spending time working on things that may not be accepted for various reasons. The steps above will help ensure that any proposals or fixes are adequately discussed and considered before any work begin, and often this will actually save you (and the steward/maintainer) time because the PR that would need additional fixing after review, or outright not accepted, would happen less often as a result.
6161

62-
**We see contributing to p5.js as a learning opportunity** and we don't measure sucess by only looking at the volume of contributions we received. There is no time limit on how long it takes you to complete a contribution, so take your time and work at your own pace (we may check in after a long period of inactivity). Ask for help from any of the stewards or maintainers if you need them and we'll try our best to support you. For information related to area stewards or general maintenance of p5.js GitHub repository, please check out the [steward guidelines](../steward_guidelines/).
62+
**We see contributing to p5.js as a learning opportunity** and we don't measure success by only looking at the volume of contributions we received. There is no time limit on how long it takes you to complete a contribution, so take your time and work at your own pace (we may check in after a long period of inactivity). Ask for help from any of the stewards or maintainers if you need them and we'll try our best to support you. For information related to area stewards or general maintenance of p5.js GitHub repository, please check out the [steward guidelines](../steward_guidelines/).
6363

6464
## Non-source code contribution
6565

0 commit comments

Comments
 (0)