Skip to content

Commit

Permalink
Make download link external
Browse files Browse the repository at this point in the history
We need a fancy redirection page.
  • Loading branch information
shatyuka committed Dec 18, 2024
1 parent 54c17e3 commit 54628ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions home/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default defineConfig({
{
text: 'Download',
items: [
{ text: 'Latest Stable', link: '/latest-release' },
{ text: 'Latest Preview', link: '/pre-release' }
{ text: 'Latest Stable', link: '/latest-release', target: '_blank' },
{ text: 'Latest Preview', link: '/pre-release', target: '_blank' }
]
},
{
Expand Down
7 changes: 3 additions & 4 deletions home/latest-release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Redirecting to Latest Release...
layout: page
sidebar: false
navbar: false
---

<script setup>
Expand All @@ -14,12 +16,9 @@ if (typeof window !== 'undefined') {
const releases = await response.json();
const latestRelease = releases.find(release => !release.prerelease);
const latestReleaseUrl = latestRelease ? latestRelease.html_url : "#";
window.open(latestReleaseUrl, "_blank");
window.location.href = "/";
window.location.href = latestReleaseUrl;
} catch (error) {
console.error("Error fetching latest release:", error);
await delay(5000)
window.location.href = "/";
}
};

Expand Down
7 changes: 3 additions & 4 deletions home/pre-release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
title: Redirecting to Pre-Release...
layout: page
sidebar: false
navbar: false
---

<script setup>
Expand All @@ -14,12 +16,9 @@ if (typeof window !== 'undefined') {
const releases = await response.json();
const preRelease = releases.find(release => release.prerelease);
const preReleaseUrl = preRelease ? preRelease.html_url : "#";
window.open(preReleaseUrl, "_blank");
window.location.href = "/";
window.location.href = preReleaseUrl;
} catch (error) {
console.error("Error fetching pre-release:", error);
await delay(5000)
window.location.href = "/";
}
};

Expand Down

0 comments on commit 54628ae

Please sign in to comment.