mirror of
https://github.com/pheralb/svgl.git
synced 2025-02-06 06:58:04 +08:00
🛠 Prepare directory page.
This commit is contained in:
parent
62a9ca8278
commit
39387e7a3e
1
src/routes/directory/+page.svelte
Normal file
1
src/routes/directory/+page.svelte
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
7
src/routes/directory/[slug]/+page.svelte
Normal file
7
src/routes/directory/[slug]/+page.svelte
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import type { PageData } from './$types';
|
||||||
|
export let data: PageData;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>{data.title}</h1>
|
||||||
|
<div>{@html data.content}</div>
|
13
src/routes/directory/[slug]/+page.ts
Normal file
13
src/routes/directory/[slug]/+page.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { error } from '@sveltejs/kit';
|
||||||
|
import type { PageLoad } from './$types';
|
||||||
|
|
||||||
|
export const load = (({ params }) => {
|
||||||
|
if (params.slug === 'hello-world') {
|
||||||
|
return {
|
||||||
|
title: 'Hello world!',
|
||||||
|
content: 'Welcome to our blog. Lorem ipsum dolor sit amet...'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
throw error(404, 'Not found');
|
||||||
|
}) satisfies PageLoad;
|
Loading…
x
Reference in New Issue
Block a user