From 739fd5616394034f501d70c011bb300d17ad6166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20M=C3=A4hr?= Date: Wed, 6 Sep 2023 21:20:10 +0200 Subject: [PATCH] wip --- src/routes/index/[...path]/+page.js | 1 + src/routes/index/[...path]/+page.svelte | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/routes/index/[...path]/+page.js b/src/routes/index/[...path]/+page.js index aa935da5..1a972794 100644 --- a/src/routes/index/[...path]/+page.js +++ b/src/routes/index/[...path]/+page.js @@ -6,6 +6,7 @@ export async function load({ params }) { if (params.path === '') { return { url: 'index.html' }; } + if (!params.path.endsWith('.html')) params.path += '.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 f54eb6b7..797ad3b5 100644 --- a/src/routes/index/[...path]/+page.svelte +++ b/src/routes/index/[...path]/+page.svelte @@ -2,8 +2,6 @@ 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';