File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ import { Code } from 'astro:components';
2626
2727const { entry, relatedEntries } = Astro .props ;
2828const currentLocale = getCurrentLocale (Astro .url .pathname );
29+ const isSound = entry .data .module === " p5.sound" ;
30+ const githubRepo = isSound
31+ ? " processing/p5.sound.js"
32+ : " processing/p5.js" ;
33+ const githubRef = isSound
34+ ? " main"
35+ : ` v${p5Version } ` ;
2936
3037const examples = parseReferenceExamplesAndMetadata (entry .data .example )
3138 // Remove empty lines at the beginning and end of the examples
@@ -300,9 +307,9 @@ const descriptionParts = description.split(
300307 entry .data .file && entry .data .line && (
301308 <div class = " my-xl" >
302309 <div class = " text-body [&_a]:text-type-magenta-dark [&_a]:!decoration-type-magenta-dark my-lg" >
303- Notice any errors or typos? <a href = " https://github.com/processing/p5.js/ issues" >Please let us know</a >. Please feel free to edit
310+ Notice any errors or typos? <a href = { ` https://github.com/${ githubRepo }/ issues ` } >Please let us know</a >. Please feel free to edit
304311 <a
305- href = { ` https://github.com/processing/p5.js/ blob/v${ p5Version }/${entry .data .file }#L${entry .data .line } ` }
312+ href = { ` https://github.com/${ githubRepo }/ blob/${ githubRef }/${entry .data .file }#L${entry .data .line } ` }
306313 >
307314 { entry .data .file }
308315 </a >
You can’t perform that action at this time.
0 commit comments