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

<script>
    export let post;
</script>

<svelte:component this={post} />
