🛠 Prepare directory page.

This commit is contained in:
Pablo Hdez 2023-03-17 13:58:59 +00:00
parent 62a9ca8278
commit 39387e7a3e
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1 @@

View 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>

View 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;