Skip to content

Commit 5a1a279

Browse files
committed
added discriptive CDN instruction to fownload page (#1229)
1 parent 31b5d84 commit 5a1a279

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/content/text-detail/en/download.mdx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
fullDownloadUrl,
99
libraryDownloadUrl,
1010
minifiedLibraryDownloadUrl
11+
p5LatestUrl
1112
} from '@src/globals/globals'
1213

1314
Welcome! This page contains the links to start using p5.js in the way that suits you best. Open the p5.js Editor in your web browser, or download the library to your own computer. We’ve tried to order the links to reflect what a beginner might want first, then what a more experienced programmer may be looking for.
@@ -31,10 +32,21 @@ These are downloads or links to the p5.js library file. No additional contents a
3132
</div>
3233

3334
## Use p5.js from CDN
34-
p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Processing.
35+
36+
All versions of p5.js are hosted on a content delivery network (CDN), a geographically distributed group of servers. There are a couple different ways to access the JavaScript library from your code editor.
37+
38+
### Current Version of p5.js (recommended)
39+
40+
Use the following URL if you'd like to access the current version of p5.js.
3541

3642
<CodeContainerWithCopy>{cdnLibraryUrl}</CodeContainerWithCopy>
3743

38-
## Older versions
39-
Looking for older versions?
40-
Head over to GitHub for [earlier releases](https://github.com/processing/p5.js/releases) of p5.js.
44+
### Latest Version of p5.js
45+
46+
Use the following URL if you'd like to ensure that you're always accessing the latest version of p5.js 2.x.
47+
48+
<CodeContainerWithCopy>{p5LatestUrl}</CodeContainerWithCopy>
49+
50+
### Other Versions of p5.js
51+
52+
If you'd like to access an earlier version of p5.js, you can look up the corresponding URL on [p5.js' jsDelivr webpage](https://www.jsdelivr.com/package/npm/p5).

src/globals/globals.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ export const cdnSoundUrl =
2626
(!!import.meta.env?.PUBLIC_P5_LIBRARY_PATH || p5Version.startsWith('v2'))
2727
? `https://cdn.jsdelivr.net/npm/p5.sound@${p5SoundVersion}` as const
2828
: `https://cdn.jsdelivr.net/npm/p5@${p5Version}/lib/addons/p5.sound.min.js` as const
29+
export const p5LatestUrl =
30+
`https://cdn.jsdelivr.net/npm/p5@2/lib/p5.min.js` as const;

0 commit comments

Comments
 (0)