From 7577dbab8f2e852ac7fd5a1279eb21682c9762bd Mon Sep 17 00:00:00 2001 From: JustRed23 Date: Wed, 24 Jul 2024 15:20:28 +0200 Subject: [PATCH] Add dynamic software url --- src/components/download/DownloadButton.vue | 2 +- src/main.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/download/DownloadButton.vue b/src/components/download/DownloadButton.vue index 4096ba4..41328a8 100644 --- a/src/components/download/DownloadButton.vue +++ b/src/components/download/DownloadButton.vue @@ -47,7 +47,7 @@ export default {

Forge {{ version.split('-')[1] }}

diff --git a/src/main.js b/src/main.js index f5d87ac..31c512b 100644 --- a/src/main.js +++ b/src/main.js @@ -85,8 +85,14 @@ export const createApp = ViteSSG( launcherUrl: "https://launcher.kettingpowered.org/", imageUrl: "https://github.com/kettingpowered.png", downloadUrl: "https://reposilite.c0d3m4513r.com/Ketting-Server-Releases/org/kettingpowered/server/forge/maven-metadata.xml", - softwareUrl: function() { - return this.githubUrl + "Ketting-1-20-x/"; + softwareUrl: function(version) { + if (version.startsWith("1.20")) { + return this.githubUrl + "Ketting-1-20-x/"; + } else if (version.startsWith("1.21")) { + return this.githubUrl + "Ketting-1-21-x/"; + } else { + return this.githubUrl + "Ketting-1-20-x/"; + } }, deprecatedVersions: ["1.20.2", "1.20.3", "1.20.4"], };