optional parameter for language, instead of rest parameter

This commit is contained in:
vcoppe
2024-08-14 09:27:53 +02:00
parent 22e9c76a5b
commit e800b2ebef
9 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@
location = location.replace(`[...${param}]`, $page.params[param]);
}
});
title = location.replace('/[...language]', '').split('/')[1] ?? 'home';
title = location.replace('/[[language]]', '').split('/')[1] ?? 'home';
}
</script>
@@ -58,13 +58,13 @@
<link
rel="alternate"
hreflang="x-default"
href="https://gpx.studio{base}{location.replace('/[...language]', '')}"
href="https://gpx.studio{base}{location.replace('/[[language]]', '')}"
/>
{#each Object.keys(languages) as lang}
<link
rel="alternate"
hreflang={lang}
href="https://gpx.studio{base}{location.replace('[...language]', lang)}"
href="https://gpx.studio{base}{location.replace('[[language]]', lang)}"
/>
{/each}
</svelte:head>

View File

@@ -7,7 +7,7 @@
import Nav from '$lib/components/Nav.svelte';
import Footer from '$lib/components/Footer.svelte';
const appRoutes = ['/[...language]/app', '/[...language]/embed'];
const appRoutes = ['/[[language]]/app', '/[[language]]/embed'];
$: showNavAndFooter = $page.route.id === null || !appRoutes.includes($page.route.id);
</script>