import { posts, type BlogPostLink } from '../../posts'; export async function load({ params }) { const post = await import(`../../${params.year}/${params.date}.md`); const tag: string = `${params.year}/${params.date}`; const postValues = posts.find((v: BlogPostLink) => v.key == tag)?.post; const content = post.default; const title: string = postValues?.title ?? ""; const date: string = postValues?.date ?? ""; const time: string = postValues?.time ?? ""; const banner: string = (postValues?.banner === "" ? "preview.webp" : postValues?.banner)!; const description: string = postValues?.description ?? ""; return { content, title, banner, date, time, tag, description, }; }