<script context="module">
    export async function load({ url, params }) {
        try {
            let post = await import(`./_posts/${params.slug}.svx`);
            return {
                props: {
                    post: post.default
                }
            }
        }
        catch (err) {
            return {
                status: 404,
                error: `Not found: ${url.pathname}`,
            }
        }
    }
</script>

<script>
    export let post;
</script>

<svelte:component this={post} />
