From 70f70b2ada08d0592c4209877d020ebe542e796c Mon Sep 17 00:00:00 2001 From: rndexe Date: Wed, 4 Dec 2024 10:03:20 +0530 Subject: [PATCH] Change github source code links based on submodule --- src/layouts/ReferenceItemLayout.astro | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/layouts/ReferenceItemLayout.astro b/src/layouts/ReferenceItemLayout.astro index 1be268ff42..e89fe36d5c 100644 --- a/src/layouts/ReferenceItemLayout.astro +++ b/src/layouts/ReferenceItemLayout.astro @@ -18,7 +18,7 @@ import type { ReferenceParam, } from "@/types/parsers.interface"; import { setJumpToState } from "../globals/state"; -import { p5Version } from "../globals/p5-version"; +import { p5Version, p5SoundVersion } from "../globals/p5-version"; import flask from "@src/content/ui/images/icons/flask.svg?raw"; const { entry, relatedEntries } = Astro.props; @@ -76,6 +76,12 @@ const relatedReferences = [ const seenParams: Record = {}; +const isSoundModule = entry.data.module === "p5.sound" +const ghSourceRepo = isSoundModule ? "p5.sound.js" : "p5.js" +const ghVersion = isSoundModule ? p5SoundVersion : p5Version +const ghIssuesUrl = `https://github.com/processing/${ghSourceRepo}/issues` +const ghSourceCodeUrl = `https://github.com/processing/${ghSourceRepo}/blob/v${ghVersion}` + --- @@ -243,9 +249,9 @@ const seenParams: Record = {}; entry.data.file && entry.data.line &&(
- Notice any errors or typos? Please let us know. Please feel free to edit + Notice any errors or typos? Please let us know. Please feel free to edit {entry.data.file}