From c379778582c5f59739ebbbcd084b7a59fe11c395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20M=C3=A4hr?= Date: Wed, 6 Sep 2023 21:18:22 +0200 Subject: [PATCH] wip --- src/routes/credits/+page.js | 2 +- src/routes/index/[...path]/+page.js | 3 +++ src/routes/index/[...path]/+page.svelte | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/routes/credits/+page.js b/src/routes/credits/+page.js index a7da5468..248ec58d 100644 --- a/src/routes/credits/+page.js +++ b/src/routes/credits/+page.js @@ -96,7 +96,7 @@ async function getCredits() { } /** @type {import('./$types').PageLoad} */ -export async function load(event) { +export async function load() { const credits = await getCredits(); return { ...credits diff --git a/src/routes/index/[...path]/+page.js b/src/routes/index/[...path]/+page.js index 7c2fca25..aa935da5 100644 --- a/src/routes/index/[...path]/+page.js +++ b/src/routes/index/[...path]/+page.js @@ -3,6 +3,9 @@ import { error } from '@sveltejs/kit'; /** @type {import('./$types').PageLoad}*/ export async function load({ params }) { + if (params.path === '') { + return { url: 'index.html' }; + } if (data.urls.includes(params.path)) { return { url: params.path }; } else { diff --git a/src/routes/index/[...path]/+page.svelte b/src/routes/index/[...path]/+page.svelte index 797ad3b5..f54eb6b7 100644 --- a/src/routes/index/[...path]/+page.svelte +++ b/src/routes/index/[...path]/+page.svelte @@ -2,6 +2,8 @@ import Container from '$lib/components/Container.svelte'; /** @type {import('./$types').PageData} */ export let data; + // append .html if not present + if (!data.url.endsWith('.html')) data.url += '.html';