2026-01-31 16:35:17 +01:00
|
|
|
import { posts, type BlogPostLink } from '../../posts';
|
2026-01-05 12:35:16 +00:00
|
|
|
|
|
|
|
|
export async function load({ params }) {
|
|
|
|
|
const post = await import(`../../${params.year}/${params.date}.md`);
|
|
|
|
|
|
|
|
|
|
const tag: string = `${params.year}/${params.date}`;
|
2026-01-31 16:35:17 +01:00
|
|
|
const postValues = posts.find((v: BlogPostLink) => v.key == tag)?.post;
|
2026-01-05 12:35:16 +00:00
|
|
|
const content = post.default;
|
2026-01-29 16:42:08 +01:00
|
|
|
const title: string = postValues?.title ?? "";
|
2026-01-05 12:35:16 +00:00
|
|
|
const date: string = postValues?.date ?? "";
|
2026-01-29 16:42:08 +01:00
|
|
|
const time: string = postValues?.time ?? "";
|
|
|
|
|
const banner: string = (postValues?.banner === "" ? "preview.webp" : postValues?.banner)!;
|
2026-01-05 12:35:16 +00:00
|
|
|
const description: string = postValues?.description ?? "";
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
content,
|
|
|
|
|
title,
|
2026-01-29 16:42:08 +01:00
|
|
|
banner,
|
2026-01-05 12:35:16 +00:00
|
|
|
date,
|
2026-01-29 16:42:08 +01:00
|
|
|
time,
|
2026-01-05 12:35:16 +00:00
|
|
|
tag,
|
|
|
|
|
description,
|
|
|
|
|
};
|
|
|
|
|
}
|