Files
maroandClaude Sonnet 5 1cd15aff25 Add email verification, personal calendar feed, and full SEO implementation
- Customer accounts now require email verification (hashed, single-use,
  time-limited tokens) before they can request/confirm bookings, with
  resend flows on login/account/booking widget and rate limiting.
- Admins get a private, rotatable iCalendar (ICS) subscription feed of
  their confirmed bookings and public events, timezone-correct for
  Europe/Berlin including DST, never exposing meeting passwords.
- Adds a full SEO layer: per-page canonical/OG/Twitter metadata with
  CMS-editable overrides and content-derived fallbacks, a dynamic
  sitemap.xml and robots.txt driven by real published content, JSON-LD
  (Organization/LocalBusiness, WebSite, WebPage, BreadcrumbList, Service,
  Event, BlogPosting) that never fabricates data, and a CMS-managed
  redirect table for changed slugs.
- Global ANOUMA-naming audit: the brand name is never used to label
  personal account/calendar areas anywhere in the app, CMS, or emails.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 22:57:31 +02:00

51 lines
1.4 KiB
TypeScript

import type { Media } from "@/payload-types";
import { mediaUrl } from "@/lib/payload/media";
type MediaRef = Media | number | null | undefined;
type SeoGroup =
| {
title?: string | null;
description?: string | null;
keywords?: string | null;
ogImage?: MediaRef;
}
| null
| undefined;
export type ResolvedSeo = {
title: string;
description: string;
keywords?: string;
ogImageUrl?: string;
};
/**
* Priority chain used everywhere on the site (see section 32 of the SEO
* brief): manual CMS field → content-derived fallback → nothing invented.
* `fallbackDescription` may be a thunk so callers only pay for building an
* excerpt (walking richText) when the manual field is actually empty.
*/
export function resolveSeo(args: {
seo?: SeoGroup;
fallbackTitle: string;
fallbackDescription: string | (() => string);
fallbackImage?: MediaRef;
defaultOgImage?: MediaRef;
}): ResolvedSeo {
const title = args.seo?.title?.trim() || args.fallbackTitle;
const description =
args.seo?.description?.trim() ||
(typeof args.fallbackDescription === "function" ? args.fallbackDescription() : args.fallbackDescription);
const ogImageUrl =
mediaUrl(args.seo?.ogImage, "hero") ?? mediaUrl(args.fallbackImage, "hero") ?? mediaUrl(args.defaultOgImage, "hero");
return {
title,
description,
keywords: args.seo?.keywords?.trim() || undefined,
ogImageUrl,
};
}