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 @@
<script lang="ts">
import Banner2 from "$lib/banner2.svelte";
import Content from "$lib/viewport/content.svelte";
import { posts, type DevlogPost, type DevlogPostLink } from "./devlog/posts";
import { posts, type DevlogPostLink } from "./devlog/posts";
import Gallery, { type GalleryEntry } from "$lib/lists/gallery.svelte";
let entries = posts.map(mapEntries);
let entries: GalleryEntry[] = posts.map(mapEntries);
function mapEntries(entry: DevlogPostLink, index: number): GalleryEntry {
return {

View File

@@ -4,7 +4,6 @@ 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: DevlogPostLink) => v.key == tag)?.post;
const content = post.default;
const title: string = postValues?.title ?? "";