From bc114dfe9230716bfad802661c89214aeafb6d9a Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Tue, 14 Apr 2026 10:53:54 +0200 Subject: [PATCH] =?UTF-8?q?feat(post-overview):=20add=20"Alle=20Beitr?= =?UTF-8?q?=C3=A4ge"=20link=20with=20arrow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds i18n-keyed link under the PostOverview block linking to /posts/. New key post_overview_all wired through translations prop from ContentRows → PostOverviewBlock. --- src/components/ContentRows.svelte | 2 +- .../blocks/PostOverviewBlock.svelte | 23 ++++++++++++++++++- src/lib/translations.ts | 5 ++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/components/ContentRows.svelte b/src/components/ContentRows.svelte index 1165904..c4baeda 100644 --- a/src/components/ContentRows.svelte +++ b/src/components/ContentRows.svelte @@ -116,7 +116,7 @@ {:else if blockType(item) === "link_list"} {:else if blockType(item) === "post_overview"} - + {:else if blockType(item) === "searchable_text"} {:else if blockType(item) === "calendar"} diff --git a/src/components/blocks/PostOverviewBlock.svelte b/src/components/blocks/PostOverviewBlock.svelte index d8c2ebf..25fcdc1 100644 --- a/src/components/blocks/PostOverviewBlock.svelte +++ b/src/components/blocks/PostOverviewBlock.svelte @@ -5,8 +5,20 @@ import type { PostOverviewBlockData } from "../../lib/block-types"; import type { PostEntry } from "../../lib/cms"; import { postHref } from "../../lib/blog-utils"; + import { t as tStatic, T } from "../../lib/translations"; + import type { Translations } from "../../lib/translations"; - let { block, class: className = "" }: { block: PostOverviewBlockData; class?: string } = $props(); + let { + block, + class: className = "", + translations = {}, + }: { + block: PostOverviewBlockData; + class?: string; + translations?: Translations | null; + } = $props(); + + const t = (key: Parameters[1]) => tStatic(translations ?? null, key); marked.setOptions({ gfm: true }); const textHtml = $derived( @@ -45,4 +57,13 @@ {/each} {/if} + + {#if posts.length > 0} + + {/if} diff --git a/src/lib/translations.ts b/src/lib/translations.ts index 649a750..6e4fdcc 100644 --- a/src/lib/translations.ts +++ b/src/lib/translations.ts @@ -154,6 +154,11 @@ const TRANSLATION_KEYS = [ "calendar_next_events", "calendar_show_more", "calendar_show_less", + "post_comments", + "post_map", + "post_map_open_osm", + "post_map_activate", + "post_overview_all", ] as const; export type TranslationKey = (typeof TRANSLATION_KEYS)[number];