feat(layout): add global announcement banner above nav
Deploy / verify (push) Successful in 1m12s
Deploy / deploy (push) Successful in 1m6s

Adds AnnouncementBanner component fed by a new top_banner CMS entry
(site-announcement). Extended top_banner schema and TS types with
optional link + linkLabel fields. Rendered inline-markdown text.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Peter Meier
2026-05-08 21:56:42 +02:00
parent 8db68e073c
commit ef163fb336
5 changed files with 70 additions and 0 deletions
@@ -0,0 +1,24 @@
<script lang="ts">
import type { TopBannerEntry } from '$lib/cms';
import { marked } from '$lib/markdown-safe';
let { banner }: { banner: TopBannerEntry } = $props();
const textHtml = $derived(banner?.text ? marked.parseInline(banner.text) as string : '');
</script>
{#if banner?.text}
<div class="w-full bg-wald-600 text-white print:hidden" role="note" style="font-size: 0.7rem;">
<div class="container-custom flex items-center gap-3 py-2 md:justify-center md:text-center">
<span>{@html textHtml}</span>
{#if banner.link}
<a
href={banner.link}
class="shrink-0 font-semibold underline underline-offset-2 hover:no-underline"
>
{banner.linkLabel ?? 'Mehr erfahren'}
</a>
{/if}
</div>
</div>
{/if}