feat(calendar): compact variant for next-events teaser
Deploy / verify (push) Successful in 1m8s
Deploy / deploy (push) Successful in 1m13s

Calendar block now supports variant: "default" | "compact".
- default = full calendar (unchanged)
- compact = next N events (default 3) + link to a target page

New CalendarCompactBlock.svelte: small card with month/day badge,
title, date/time/location line, "Alle kommenden Termine →" footer
link resolved from the schema's linkTo reference. Filters to future
events (12h tolerance for running ones).

BlockRenderer dispatches by block.variant inside the calendar case.
Schema (cms_content/_types/core/calendar.json5) adds variant + linkTo
+ limit fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Peter Meier
2026-05-22 08:49:08 +02:00
parent 055f001174
commit b7bcdd76ee
3 changed files with 130 additions and 1 deletions
+6 -1
View File
@@ -14,6 +14,7 @@
import PostOverviewBlock from "./blocks/PostOverviewBlock.svelte";
import SearchableTextBlock from "./blocks/SearchableTextBlock.svelte";
import CalendarBlock from "./blocks/CalendarBlock.svelte";
import CalendarCompactBlock from "./blocks/CalendarCompactBlock.svelte";
import OrganisationsBlock from "./blocks/OrganisationsBlock.svelte";
import OpnFormBlock from "./blocks/OpnFormBlock.svelte";
import InternalComponentBlock from "./blocks/InternalComponentBlock.svelte";
@@ -82,7 +83,11 @@
{:else if type === "searchable_text"}
<SearchableTextBlock block={block as SearchableTextBlockData} translations={translations} />
{:else if type === "calendar"}
<CalendarBlock block={block as CalendarBlockData} translations={translations} />
{#if (block as CalendarBlockData).variant === "compact"}
<CalendarCompactBlock block={block as CalendarBlockData} translations={translations} />
{:else}
<CalendarBlock block={block as CalendarBlockData} translations={translations} />
{/if}
{:else if type === "organisations"}
<OrganisationsBlock block={block as OrganisationsBlockData} />
{:else if type === "opnform"}