added blog entry

This commit is contained in:
2026-01-29 16:42:08 +01:00
parent 75674c4992
commit e98c77895a
7 changed files with 76 additions and 17 deletions

View File

@@ -1,6 +1,20 @@
<script lang="ts">
import Banner2 from "$lib/banner2.svelte";
import Content from "$lib/viewport/content.svelte";
import Gallery, { type GalleryEntry } from "$lib/lists/gallery.svelte";
import { posts, type BlogPostDetails } from "./posts";
let entries: GalleryEntry[] = posts.entries().map(mapEntries).toArray();
function mapEntries(m: [String, BlogPostDetails], index: number): GalleryEntry {
return {
title: `${m[1].title}`,
subtitle: `#${posts.size - index} // ${m[1].date}, ${m[1].time}`,
img: `/blog/${m[0]}/${m[1].banner}`,
link: `/blog/${m[0]}/`,
imgAlt: `Preview image for ${m[1].title}`,
};
}
</script>
<svelte:head>
@@ -11,5 +25,5 @@
<Banner2
title="Blog" />
<p>content coming soon!</p>
<Gallery entries={entries} reverseTextOrder />
</Content>