Skip to content

Commit 4d008d1

Browse files
Merge branch '2.0' into fix/p5.strands-tutorial-code-formatting
2 parents 8d9d4bd + d671cb3 commit 4d008d1

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/layouts/ReferenceItemLayout.astro

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ import { Code } from 'astro:components';
2626
2727
const { entry, relatedEntries } = Astro.props;
2828
const 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
3037
const 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>

0 commit comments

Comments
 (0)