moved blog over to BlogPostLink data type to fix error 500 on page refresh
This commit is contained in:
@@ -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 ?? "";
|
||||
|
||||
Reference in New Issue
Block a user