figure out how everything works again

This commit is contained in:
2022-05-11 20:41:23 -07:00
parent 8c6e39c6e6
commit 8d51cab348
8 changed files with 31 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
<script context="module">
export async function load({ page }) {
export async function load({ url, params }) {
try {
let post = await import(`./_posts/${page.params.slug}.svx`);
let post = await import(`./_posts/${params.slug}.svx`);
return {
props: {
post: post.default
@@ -9,9 +9,10 @@
}
}
catch (err) {
console.log(err);
return {
status: 404,
error: `Not found: ${page.path}`,
error: `Not found: ${url.pathname}`,
}
}
}