mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 01:00:12 +00:00
port docs to sveltekit (very broken)
This commit is contained in:
parent
17ee73f264
commit
b19c900cc3
39 changed files with 3275 additions and 8052 deletions
7
docs/src/routes/[...slug]/+page.svelte
Normal file
7
docs/src/routes/[...slug]/+page.svelte
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<script>
|
||||
let { data } = $props();
|
||||
</script>
|
||||
|
||||
<div class="max-w-full bg-base-200 prose">
|
||||
<div class="m-5" style="max-width: 900px"><data.PageContent /></div>
|
||||
</div>
|
||||
16
docs/src/routes/[...slug]/+page.ts
Normal file
16
docs/src/routes/[...slug]/+page.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { error } from '@sveltejs/kit';
|
||||
|
||||
const pages = import.meta.glob('/content/**/*.md', { eager: true }) as Record<string, { default: unknown }>;
|
||||
|
||||
export async function load({ params }) {
|
||||
const slug = params.slug || 'index';
|
||||
|
||||
const page = pages[`/content/${slug}.md`] || pages[`/content/${slug}/index.md`];
|
||||
if (!page) {
|
||||
throw error(404, `Page not found: ${slug}`);
|
||||
}
|
||||
|
||||
return {
|
||||
PageContent: page.default
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue