22 lines
592 B
TypeScript
22 lines
592 B
TypeScript
|
|
import { posts, type BlogPostDetails } 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 content = post.default;
|
||
|
|
const title: string = postValues?.fullTitle ?? "";
|
||
|
|
const date: string = postValues?.date ?? "";
|
||
|
|
// const bannerAlt: string = postValues?.bannerAlt ?? "";
|
||
|
|
const description: string = postValues?.description ?? "";
|
||
|
|
|
||
|
|
return {
|
||
|
|
content,
|
||
|
|
title,
|
||
|
|
date,
|
||
|
|
tag,
|
||
|
|
// bannerAlt,
|
||
|
|
description,
|
||
|
|
};
|
||
|
|
}
|