feat(deadline-banner): auto mode pulls all calendar_items globally
Auto-mode deadline_banner now resolves to the next future event across all calendar_items in the CMS instead of requiring a manually-curated items[] pool. Server load hooks (+page.server.ts for /, /[...slug], /post/[slug]) call resolveDeadlineBannerBlocks which fetches the global calendar_item list once and attaches it as items[] when mode is "auto" and items[] is not already resolved. Component logic unchanged — it still picks the soonest future entry. Also: - cms.ts: getCalendarItems() bulk list fetcher - PostOverviewBlock.svelte: design defaults to "cards" when value is empty string (not just null/undefined) so existing entries with design: "" render Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -191,6 +191,30 @@ export interface PostOverviewBlockData {
|
||||
postsResolved?: unknown[];
|
||||
}
|
||||
|
||||
/** Deadline-Banner (_type: "deadline_banner"). Schmaler Balken unter Hero. */
|
||||
export interface DeadlineBannerBlockData {
|
||||
_type?: "deadline_banner";
|
||||
_slug?: string;
|
||||
mode?: "manual" | "auto";
|
||||
label?: string;
|
||||
text?: string;
|
||||
date?: string;
|
||||
items?: Array<
|
||||
| string
|
||||
| {
|
||||
_slug?: string;
|
||||
title?: string;
|
||||
terminZeit?: string;
|
||||
description?: string;
|
||||
link?: string | { url?: string; linkName?: string; newTab?: boolean; _slug?: string };
|
||||
}
|
||||
>;
|
||||
link?: string | { url?: string; linkName?: string; newTab?: boolean; _slug?: string };
|
||||
variant?: "accent" | "urgent" | "info";
|
||||
showCountdown?: boolean;
|
||||
layout?: BlockLayout;
|
||||
}
|
||||
|
||||
/** Tag-Referenz (API liefert oft { _slug, _type, name }). */
|
||||
export type SearchableTextTagRef = string | { _slug?: string; name?: string };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user