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>
This commit is contained in:
@@ -10,6 +10,7 @@ export const dynamic = "force-dynamic";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Meeting beitreten",
|
||||
robots: { index: false, follow: false },
|
||||
};
|
||||
|
||||
type Args = { params: Promise<{ slug: string }> };
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { notFound, permanentRedirect, redirect } from "next/navigation";
|
||||
import Link from "next/link";
|
||||
import { headers } from "next/headers";
|
||||
import { getPayload } from "payload";
|
||||
@@ -11,29 +11,64 @@ import { RichText } from "@/components/RichText";
|
||||
import { CTA } from "@/components/CTA";
|
||||
import { RegisterForm } from "@/components/meeting/RegisterForm";
|
||||
import { getEventBySlug } from "@/lib/payload/content";
|
||||
import { getBookingSettingsGlobal, getSEOSettingsGlobal } from "@/lib/payload/globals";
|
||||
import { mediaAlt, mediaUrl } from "@/lib/payload/media";
|
||||
import { formatFullDate, formatTimeRange } from "@/lib/format";
|
||||
import { EVENT_CATEGORIES } from "@/collections/Events";
|
||||
import { canJoinMeeting, combineDateAndTime, getMeetingStatus, statusLabel } from "@/lib/meeting/status";
|
||||
import { resolveSeo } from "@/lib/seo/resolve";
|
||||
import { buildMetadata } from "@/lib/seo/metadata";
|
||||
import { getSiteUrl } from "@/lib/seo/config";
|
||||
import { excerptFromRichText } from "@/lib/seo/textExcerpt";
|
||||
import { JsonLd, eventJsonLd } from "@/lib/seo/jsonld";
|
||||
import { resolveRedirect } from "@/lib/seo/redirects";
|
||||
import { siteConfig } from "@/lib/site";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
type Args = { params: Promise<{ slug: string }> };
|
||||
|
||||
async function resolveEventOrRedirect(slug: string) {
|
||||
const event = await getEventBySlug(slug);
|
||||
if (event) return event;
|
||||
|
||||
const match = await resolveRedirect(`/termine/${slug}`);
|
||||
if (match) {
|
||||
if (match.permanent) permanentRedirect(match.to);
|
||||
redirect(match.to);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: Args): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const event = await getEventBySlug(slug);
|
||||
const [event, seoSettings] = await Promise.all([getEventBySlug(slug), getSEOSettingsGlobal()]);
|
||||
if (!event) return {};
|
||||
return { title: event.title };
|
||||
|
||||
const resolved = resolveSeo({
|
||||
seo: event.seo,
|
||||
fallbackTitle: `${event.title} – ${siteConfig.name}`,
|
||||
fallbackDescription: () => excerptFromRichText(event.description) || `${event.title} bei ${siteConfig.name}.`,
|
||||
fallbackImage: event.image,
|
||||
defaultOgImage: seoSettings.defaultOgImage,
|
||||
});
|
||||
return buildMetadata({
|
||||
title: resolved.title,
|
||||
description: resolved.description,
|
||||
path: `/termine/${event.slug}`,
|
||||
ogImageUrl: resolved.ogImageUrl,
|
||||
keywords: resolved.keywords,
|
||||
});
|
||||
}
|
||||
|
||||
export default async function EventDetailPage({ params }: Args) {
|
||||
const { slug } = await params;
|
||||
const event = await getEventBySlug(slug);
|
||||
const event = await resolveEventOrRedirect(slug);
|
||||
if (!event) notFound();
|
||||
|
||||
const categoryLabel = EVENT_CATEGORIES.find((c) => c.value === event.category)?.label;
|
||||
const time = formatTimeRange(event.startTime, event.endTime);
|
||||
const [siteUrl, bookingSettings] = await Promise.all([getSiteUrl(), getBookingSettingsGlobal()]);
|
||||
|
||||
let meetingCard = null;
|
||||
if (event.isOnline) {
|
||||
@@ -76,6 +111,17 @@ export default async function EventDetailPage({ params }: Args) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<JsonLd
|
||||
data={eventJsonLd({
|
||||
event,
|
||||
description: event.seo?.description || excerptFromRichText(event.description) || `${event.title} bei ${siteConfig.name}.`,
|
||||
imageUrl: mediaUrl(event.image, "hero"),
|
||||
joinUrl: event.isOnline ? `${siteUrl}/termine/${slug}/beitreten` : undefined,
|
||||
siteUrl,
|
||||
providerName: siteConfig.name,
|
||||
booking: bookingSettings,
|
||||
})}
|
||||
/>
|
||||
<PageHeader
|
||||
eyebrow={categoryLabel}
|
||||
title={event.title}
|
||||
|
||||
Reference in New Issue
Block a user