Files
clan-core/site/src/routes/+layout.ts
2025-10-08 14:53:18 +02:00

18 lines
424 B
TypeScript

import * as config from "~/config";
import { Docs } from "./docs";
export const prerender = true;
export const trailingSlash = "always";
export async function load({ url }) {
const path = url.pathname.endsWith("/")
? url.pathname.slice(0, -1)
: url.pathname;
return {
docs:
path != config.docs.base && !path.startsWith(`${config.docs.base}/`)
? null
: await new Docs().init(),
};
}