File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ Use the following URL if you'd like to access the current version of p5.js.
4343
4444### Latest Version of p5.js
4545
46- Use the following URL if you'd like to ensure that you're always accessing the latest version of p5.js 2 .x.
46+ Use the following URL if you'd like to ensure that you're always accessing the latest version of p5.js { p5MajorVersion } .x.
4747
4848<CodeContainerWithCopy >{ p5LatestUrl } </CodeContainerWithCopy >
4949
Original file line number Diff line number Diff line change @@ -26,5 +26,7 @@ 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 p5MajorVersion =
30+ p5Version . split ( '.' ) [ 0 ] as const ;
2931export const p5LatestUrl =
30- `https://cdn.jsdelivr.net/npm/p5@2 /lib/p5.min.js` as const ;
32+ `https://cdn.jsdelivr.net/npm/p5@${ p5Version . split ( '.' ) [ 0 ] } /lib/p5.min.js` as const ;
You can’t perform that action at this time.
0 commit comments