initial commit
This commit is contained in:
20
src/routes/[slug].svelte
Normal file
20
src/routes/[slug].svelte
Normal file
@@ -0,0 +1,20 @@
|
||||
<script context="module">
|
||||
export async function load({ page }) {
|
||||
let post = await import(`./_posts/${page.params.slug}.svx`);
|
||||
return {
|
||||
props: {
|
||||
metadata: post.metadata,
|
||||
BlogPost: post.default
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
export let metadata, BlogPost;
|
||||
</script>
|
||||
|
||||
<div id="post">
|
||||
<h1>{metadata.title}</h1>
|
||||
<svelte:component this={BlogPost} />
|
||||
</div>
|
Reference in New Issue
Block a user