Skip to content

Commit

Permalink
Add dynamic software url
Browse files Browse the repository at this point in the history
  • Loading branch information
JustRed23 committed Jul 24, 2024
1 parent d148730 commit 7577dba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/download/DownloadButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default {
<p id="forge-version" v-if="duplicate">Forge {{ version.split('-')[1] }}</p>
</div>
<div id="right">
<a id="compare" v-if="compareVersion != null" :href="global.softwareUrl() + 'compare/' + compareVersion + '...' + version" target="_blank" tabindex=0 >What's new?</a>
<a id="compare" v-if="compareVersion != null" :href="global.softwareUrl(mcVersion) + 'compare/' + compareVersion + '...' + version" target="_blank" tabindex=0 >What's new?</a>
<p id="get" @click="this.$emit('toggle-details')" tabindex=0 role="note" aria-label="Get it">Get it</p>
</div>
</div>
Expand Down
10 changes: 8 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
};
Expand Down

0 comments on commit 7577dba

Please sign in to comment.