feat(post-overview): add "Alle Beiträge" link with arrow
Deploy to Firebase Hosting / deploy (push) Has been cancelled
Deploy to Firebase Hosting / deploy (push) Has been cancelled
Adds i18n-keyed link under the PostOverview block linking to /posts/. New key post_overview_all wired through translations prop from ContentRows → PostOverviewBlock.
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
{:else if blockType(item) === "link_list"}
|
||||
<LinkListBlock block={item as LinkListBlockData} />
|
||||
{:else if blockType(item) === "post_overview"}
|
||||
<PostOverviewBlock block={item as PostOverviewBlockData} />
|
||||
<PostOverviewBlock block={item as PostOverviewBlockData} translations={translations} />
|
||||
{:else if blockType(item) === "searchable_text"}
|
||||
<SearchableTextBlock block={item as SearchableTextBlockData} translations={translations} />
|
||||
{:else if blockType(item) === "calendar"}
|
||||
|
||||
@@ -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<typeof tStatic>[1]) => tStatic(translations ?? null, key);
|
||||
|
||||
marked.setOptions({ gfm: true });
|
||||
const textHtml = $derived(
|
||||
@@ -45,4 +57,13 @@
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if posts.length > 0}
|
||||
<div class="mt-3 text-sm">
|
||||
<a href="/posts/" class="inline-flex items-center gap-1 text-zinc-700 hover:text-zinc-900 hover:underline">
|
||||
{t(T.post_overview_all)}
|
||||
<span aria-hidden="true">→</span>
|
||||
</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user