added structure for blog posts

This commit is contained in:
2026-01-05 12:35:16 +00:00
parent 022c1eeeae
commit bd68821ca6
7 changed files with 83 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
<script>
import BannerTitleAlt from "$lib/banner-title-alt.svelte";
import Content from "$lib/content.svelte";
import TableOfContents from "$lib/table-of-contents.svelte";
export let data;
</script>
<svelte:head>
<title>{data.title} | denizk0461</title>
<meta name="description" content="{data.description}">
</svelte:head>
<BannerTitleAlt
title="{data.title}"
date="{data.date}"
banner="preview.webp"
bannerAlt="{""/*data.bannerAlt*/}"
/>
<Content useContentWidth>
<TableOfContents disableStickyScrolling />
<svelte:component this={data.content} />
</Content>

View File

@@ -0,0 +1,22 @@
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,
};
}