enable trailing slash on layout (excluding api paths)
This commit is contained in:
parent
d5b54722b3
commit
41066eefe4
@ -1,9 +1,11 @@
|
||||
import type { LayoutServerLoad } from "./$types";
|
||||
import type { LayoutServerLoad } from './$types';
|
||||
|
||||
export const trailingSlash = 'always';
|
||||
|
||||
export const load: LayoutServerLoad = async (event) => {
|
||||
const { user } = event.locals;
|
||||
|
||||
return {
|
||||
user
|
||||
user,
|
||||
};
|
||||
};
|
||||
|
@ -20,9 +20,9 @@
|
||||
<ul class="flex items-center gap-6 overflow-x-auto text-sm">
|
||||
<li><a href="/" class={getNavClass(/^\/$/)}>Home</a></li>
|
||||
{#if user}
|
||||
<li><a href="/user" class={getNavClass(/^\/user$/)}>Profile</a></li>
|
||||
<li><a href="/connections" class={getNavClass(/^\/connections$/)}>Connections</a></li>
|
||||
<li><a href="/clients" class={getNavClass(/^\/clients(\/\d+)?$/)}>Clients</a></li>
|
||||
<li><a href="/user/" class={getNavClass(/^\/user\/$/)}>Profile</a></li>
|
||||
<li><a href="/connections/" class={getNavClass(/^\/connections\/$/)}>Connections</a></li>
|
||||
<li><a href="/clients/" class={getNavClass(/^\/clients(\/\d+)?\/$/)}>Clients</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
</nav>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<section id="get-started" class="border-l-2 pl-6">
|
||||
<p>
|
||||
To get started,
|
||||
<Button class="ml-2" href="/clients?add=New+Client">Create a New Client</Button>
|
||||
<Button class="ml-2" href="/clients/?add=New+Client">Create a New Client</Button>
|
||||
</p>
|
||||
</section>
|
||||
<!-- <section id="using-wireguard">-->
|
||||
|
@ -15,7 +15,7 @@ export const actions = {
|
||||
|
||||
switch (res._tag) {
|
||||
case 'ok': {
|
||||
return redirect(303, `/clients/${res.value}`);
|
||||
return redirect(303, `/clients/${res.value}/`);
|
||||
}
|
||||
case 'err': {
|
||||
const [status, message] = res.error;
|
||||
|
@ -41,7 +41,7 @@
|
||||
<Table.Row class="group hover:bg-background hover:bg-opacity-40">
|
||||
<Table.Head scope="row">
|
||||
<a
|
||||
href={`./${client.id}`}
|
||||
href={`./${client.id}/`}
|
||||
class="flex size-full items-center group-hover:underline"
|
||||
>
|
||||
{client.name}
|
||||
|
Loading…
x
Reference in New Issue
Block a user