moved blog over to BlogPostLink data type to fix error 500 on page refresh

This commit is contained in:
2026-01-31 16:35:17 +01:00
parent 06b4d9c318
commit 6c8d0aae08
5 changed files with 30 additions and 22 deletions

View File

@@ -1,10 +1,10 @@
import { posts, type BlogPostDetails } from '../../posts';
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.get(tag);
const postValues = posts.find((v: BlogPostLink) => v.key == tag)?.post;
const content = post.default;
const title: string = postValues?.title ?? "";
const date: string = postValues?.date ?? "";