changed blog tags to string enum; added blog post entry gallery

This commit is contained in:
2026-03-31 12:56:57 +02:00
parent 159ba59500
commit 61875ab08e
3 changed files with 42 additions and 21 deletions

View File

@@ -1,26 +1,27 @@
<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 Gallery, { type GalleryEntry } from "$lib/lists/gallery.svelte";
import { posts, type BlogPostLink } from "./posts";
import BlogGallery from "$lib/lists/blog-gallery.svelte";
let entries: GalleryEntry[] = posts.map(mapEntries);
// let entries: GalleryEntry[] = posts.map(mapEntries);
function mapEntries(entry: BlogPostLink, index: number): GalleryEntry {
let banner = "";
if (entry.post.banner && entry.post.banner !== "") {
banner = `/blog/${entry.key}/${entry.post.banner}`;
}
// function mapEntries(entry: BlogPostLink, index: number): GalleryEntry {
// let banner = "";
// if (entry.post.banner && entry.post.banner !== "") {
// banner = `/blog/${entry.key}/${entry.post.banner}`;
// }
return {
title: `${entry.post.title}`,
subtitle: `#${(posts.length - index).toString().padStart(2, '0')} // ${entry.post.date}, ${entry.post.time}`,
img: banner,
link: `/blog/${entry.key}/`,
imgAlt: `Preview image for ${entry.post.title}`,
description: entry.post.description,
};
}
// return {
// title: `${entry.post.title}`,
// subtitle: `#${(posts.length - index).toString().padStart(2, '0')} // ${entry.post.date}, ${entry.post.time}`,
// img: banner,
// link: `/blog/${entry.key}/`,
// imgAlt: `Preview image for ${entry.post.title}`,
// description: entry.post.description,
// };
// }
</script>
<svelte:head>
@@ -33,5 +34,5 @@
banner="robert.webp"
bannerAlt="View at a tram bridge rising and then curving to the left." />
<Gallery entries={entries} />
<BlogGallery {posts} />
</Content>