Skip to content

Commit 49b2529

Browse files
committed
🖇️ Fix download links
1 parent 6de2a0b commit 49b2529

File tree

5 files changed

+17
-30
lines changed

5 files changed

+17
-30
lines changed

src/lib/downloadLinks.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { redirect } from '@sveltejs/kit'
2+
3+
const LATEST_RELEASE =
4+
'https://github.com/Animated-Java/animated-java/releases/latest/download/animated_java.js'
5+
const SPECIFIC_VERSION =
6+
'https://github.com/Animated-Java/animated-java/releases/download/{VERSION}/animated_java.js'
7+
8+
export const prerender = true
9+
10+
export function load({ params }) {
11+
console.log(params.version)
12+
if (params.version === 'latest') {
13+
throw redirect(302, LATEST_RELEASE)
14+
} else {
15+
throw redirect(302, SPECIFIC_VERSION.replace('{VERSION}', params.version))
16+
}
17+
}

src/routes/download/latest/+page.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/routes/download/legacy_armorstands/+page.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/routes/download/legacy_beta/+page.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)