Loading the latest md file.
<script context="module">
/** @type {import("@sveltejs/kit").Load} */
export const load = async () => {
let headlinePath = dateSortedPosts[0].path;
const allPosts = import.meta.glob("./*.md");
const headlinePost = await allPosts[headlinePath]();
// you can get .metadata if you want
const headlinePage = headlinePost.default;
return { props: { headlinePage } };
}
</script>
<script>
export let headlinePage;
</script>
<div class="headlinePost">
<svelte:component this={headlinePage} />
</div>