feat(website): church details, settings, audit log, search engine data, safer editing
Church details saved through Accounts' church.update (live at once). Settings: Search Console and Bing codes, Coming soon line, menu order. Audit log and recent edits. A made share image, Event / VideoObject / PodcastEpisode / BreadcrumbList structured data, permanent redirects from old page addresses. Saves refused when someone else saved in between; Ministry leaders' events; templates previewed with the church's own content before choosing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
import { notFound, permanentRedirect, redirect } from "next/navigation";
|
||||
import { loadContent } from "@/site/load";
|
||||
import { churchLd, pageMetadata } from "@/site/meta";
|
||||
import { breadcrumbLd, churchLd, messagesLd, pageMetadata } from "@/site/meta";
|
||||
import { PageView } from "@/site/PageView";
|
||||
import { Shell } from "@/site/Shell";
|
||||
|
||||
@@ -23,11 +23,20 @@ export default async function SitePage({ params }: Props) {
|
||||
const { c, page } = await find(slug);
|
||||
// Before the first publish every address shows Coming soon, on the home page.
|
||||
if (c.mode !== "published") redirect("/");
|
||||
if (!page) notFound();
|
||||
const ld = page.kind === "contact" ? churchLd(c, page.path) : null;
|
||||
if (!page) {
|
||||
// A page's earlier address: on to where it is now, permanently (§6).
|
||||
const moved = c.snapshot.redirects?.[slug];
|
||||
if (moved) permanentRedirect(moved);
|
||||
notFound();
|
||||
}
|
||||
const lds = [
|
||||
breadcrumbLd(c, [{ name: page.title, path: page.path }]),
|
||||
page.kind === "contact" ? churchLd(c, page.path) : null,
|
||||
page.kind === "messages" ? messagesLd(c, c.messages) : null,
|
||||
].filter((x): x is string => !!x);
|
||||
return (
|
||||
<Shell site={c} path={page.path}>
|
||||
{ld && <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: ld }} />}
|
||||
{lds.map((ld, i) => <script key={i} type="application/ld+json" dangerouslySetInnerHTML={{ __html: ld }} />)}
|
||||
<PageView page={page} site={c} />
|
||||
</Shell>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
"use client";
|
||||
|
||||
/** The audit log (§4, §10): who changed what, and when. Owners and Admins see it. */
|
||||
import { useState } from "react";
|
||||
import { api } from "@/admin/api";
|
||||
import { Btn, Loading, Panel, Title, useAdmin, when } from "@/admin/ui";
|
||||
|
||||
type Entry = { at: string; who: string; action: string; detail: string | null };
|
||||
|
||||
export default function Audit() {
|
||||
const first = useAdmin<Entry[]>("/audit");
|
||||
const [more, setMore] = useState<Entry[]>([]);
|
||||
const [done, setDone] = useState(false);
|
||||
if (!first.data) return <Loading error={first.error} />;
|
||||
const all = [...first.data, ...more];
|
||||
return (
|
||||
<>
|
||||
<Title sub="Who changed what, newest first.">Audit log</Title>
|
||||
<Panel>
|
||||
{all.length === 0 && <p className="text-gray-600">Nothing yet.</p>}
|
||||
<table className="w-full text-left text-sm">
|
||||
<thead className="text-gray-600"><tr><th className="py-2 pr-4 font-medium">When</th><th className="py-2 pr-4 font-medium">Who</th><th className="py-2 font-medium">What</th></tr></thead>
|
||||
<tbody className="divide-y divide-gray-200">
|
||||
{all.map((e, i) => (
|
||||
<tr key={`${e.at}-${i}`}>
|
||||
<td className="whitespace-nowrap py-2 pr-4 text-gray-600">{when(e.at)}</td>
|
||||
<td className="py-2 pr-4">{e.who}</td>
|
||||
<td className="py-2">{e.action}{e.detail && <span className="text-gray-600">: {e.detail}</span>}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
{!done && all.length >= 100 && (
|
||||
<Btn className="mt-4" onClick={async () => {
|
||||
const next = await api<Entry[]>(`/audit?before=${encodeURIComponent(all.at(-1)!.at)}`);
|
||||
if (!next.length) setDone(true);
|
||||
setMore([...more, ...next]);
|
||||
}}>Show older</Btn>
|
||||
)}
|
||||
</Panel>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* Church details (§2, decision 10): the facts every one of the church's sites shows (name, colours,
|
||||
* fonts and corners, logo, service times, contact, social links). They belong to the church's
|
||||
* Accounts and are saved there; they're not drafts: they change on all its sites at once.
|
||||
*/
|
||||
import { useState } from "react";
|
||||
import type { Church } from "@crosscode/contracts";
|
||||
import { api, canEdit } from "@/admin/api";
|
||||
import { ImagePicker } from "@/admin/media";
|
||||
import { Btn, Field, inputClass, Loading, Notice, Panel, Title, useAction, useAdmin } from "@/admin/ui";
|
||||
|
||||
const DAYS = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
|
||||
const PAIRINGS: [string, string][] = [["", "Your template's choice"], ["classic", "Classic"], ["scholarly", "Scholarly"], ["editorial", "Editorial"], ["impact", "Impact"], ["contemporary", "Contemporary"], ["friendly", "Friendly"], ["warm", "Warm"], ["modern", "Modern"]];
|
||||
const NETWORKS = ["facebook", "instagram", "youtube", "tiktok", "x", "spotify", "whatsapp-channel", "other"];
|
||||
|
||||
type ServiceTime = Church["serviceTimes"][number];
|
||||
type Social = Church["social"][number];
|
||||
type Address = NonNullable<Church["contact"]["address"]>;
|
||||
|
||||
export default function ChurchDetails() {
|
||||
const me = useAdmin<{ user: { role: string } }>("/me");
|
||||
const { data, error, reload } = useAdmin<{ church: Church | null; linked: boolean }>("/church");
|
||||
const { busy, message, fields, run } = useAction();
|
||||
const [edit, setEdit] = useState<Partial<Church> & { logoMediaId?: string | null } | null>(null);
|
||||
if (!data || !me.data) return <Loading error={error ?? me.error} />;
|
||||
if (!data.church) return <><Title>Church details</Title><Notice tone="warning">{data.linked ? "Your church's details can't be read from Accounts right now. Try again in a minute." : "This website isn't linked to your church's Accounts yet. It links by itself within 15 minutes of being installed."}</Notice></>;
|
||||
const c: Church = { ...data.church, ...edit } as Church;
|
||||
const editor = canEdit(me.data.user.role);
|
||||
const set = (patch: Partial<Church>) => setEdit({ ...edit, ...patch });
|
||||
const times = c.serviceTimes;
|
||||
const setTime = (i: number, t: Partial<ServiceTime>) => set({ serviceTimes: times.map((x, j) => (j === i ? { ...x, ...t } : x)) });
|
||||
const address: Address = c.contact.address ?? { line1: "", line2: null, suburb: null, city: "", province: null, postalCode: null, country: "ZA", geo: null };
|
||||
const setAddress = (a: Partial<Address>) => set({ contact: { ...c.contact, address: { ...address, ...a } } });
|
||||
const save = () => run(async () => {
|
||||
// The media id only picks the logo here; Accounts keeps its address.
|
||||
const changes = { ...(edit ?? {}) };
|
||||
delete changes.logoMediaId;
|
||||
await api("/church", { method: "PUT", body: { church: changes, ifUpdatedAt: data.church!.updatedAt } });
|
||||
setEdit(null);
|
||||
await reload();
|
||||
}, "Saved: all your church's sites show it now.");
|
||||
const err = (k: string) => fields[k];
|
||||
return (
|
||||
<>
|
||||
<Title sub="These show on all your church's sites (this website, Cross Events, the sign-in pages). Changes here go live straight away: they aren't drafts."
|
||||
actions={editor && edit && <><Btn onClick={() => setEdit(null)}>Undo</Btn><Btn kind="primary" busy={busy} onClick={save}>Save for all your sites</Btn></>}>
|
||||
Church details
|
||||
</Title>
|
||||
{message && <div className="mb-4"><Notice tone={message.tone}>{message.text}</Notice></div>}
|
||||
<fieldset disabled={!editor} className="space-y-6">
|
||||
<Panel title="Name and look">
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<Field label="Church name" error={err("name")}><input className={inputClass} value={c.name} maxLength={200} onChange={(e) => set({ name: e.target.value })} /></Field>
|
||||
<Field label="Short name" hint="For tight spaces." error={err("shortName")}><input className={inputClass} value={c.shortName ?? ""} maxLength={30} onChange={(e) => set({ shortName: e.target.value || null })} /></Field>
|
||||
<Field label="Main colour" error={err("branding.colours.primary")}><input type="color" className="h-10 w-20" value={c.branding.colours.primary} onChange={(e) => set({ branding: { ...c.branding, colours: { ...c.branding.colours, primary: e.target.value } } })} /></Field>
|
||||
<Field label="Accent colour"><input type="color" className="h-10 w-20" value={c.branding.colours.accent ?? "#999999"} onChange={(e) => set({ branding: { ...c.branding, colours: { ...c.branding.colours, accent: e.target.value } } })} /></Field>
|
||||
<Field label="Fonts" hint="Shared by all your sites. Your template suggests some.">
|
||||
<select className={inputClass} value={c.branding.style?.fontPairing ?? ""} onChange={(e) => set({ branding: { ...c.branding, style: { fontPairing: (e.target.value || null) as never, corners: c.branding.style?.corners ?? null } } })}>
|
||||
{PAIRINGS.map(([v, l]) => <option key={v} value={v}>{l}</option>)}
|
||||
</select>
|
||||
</Field>
|
||||
<Field label="Corners">
|
||||
<select className={inputClass} value={c.branding.style?.corners ?? ""} onChange={(e) => set({ branding: { ...c.branding, style: { fontPairing: c.branding.style?.fontPairing ?? null, corners: (e.target.value || null) as never } } })}>
|
||||
<option value="">Your template's choice</option><option value="sharp">Sharp</option><option value="soft">Soft</option><option value="round">Round</option>
|
||||
</select>
|
||||
</Field>
|
||||
<div className="sm:col-span-2">
|
||||
{c.branding.logoUrl && <img src={c.branding.logoUrl} alt="Your logo" className="mb-2 h-12 w-auto" />}
|
||||
<ImagePicker label="Logo (a photo from the media library)" value={edit?.logoMediaId ?? null}
|
||||
onChange={(id) => run(async () => {
|
||||
if (!id) return set({ branding: { ...c.branding, logoUrl: null }, logoMediaId: null } as never);
|
||||
const media = await api<{ items: { id: string; url: string }[] }>("/media");
|
||||
const url = media.items.find((m) => m.id === id)?.url;
|
||||
set({ branding: { ...c.branding, logoUrl: url ? `${window.location.origin}${url}` : null }, logoMediaId: id } as never);
|
||||
})} />
|
||||
</div>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<Panel title="Service times">
|
||||
<ul className="space-y-3">
|
||||
{times.map((t, i) => (
|
||||
<li key={i} className="grid gap-2 sm:grid-cols-[8rem_7rem_1fr_1fr_auto]">
|
||||
<select aria-label="Day" className={inputClass} value={t.day} onChange={(e) => setTime(i, { day: e.target.value as ServiceTime["day"] })}>{DAYS.map((d) => <option key={d} value={d}>{d[0]!.toUpperCase() + d.slice(1)}</option>)}</select>
|
||||
<input aria-label="Time" type="time" className={inputClass} value={t.time} onChange={(e) => setTime(i, { time: e.target.value })} />
|
||||
<input aria-label="Name (e.g. Morning service)" placeholder="E.g. Morning service" className={inputClass} value={t.label ?? ""} maxLength={100} onChange={(e) => setTime(i, { label: e.target.value || null })} />
|
||||
<input aria-label="Note" placeholder="E.g. Kids church during the service" className={inputClass} value={t.note ?? ""} maxLength={300} onChange={(e) => setTime(i, { note: e.target.value || null })} />
|
||||
<Btn kind="danger" onClick={() => set({ serviceTimes: times.filter((_, j) => j !== i) })}>Remove</Btn>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{err("serviceTimes") && <p className="mt-2 text-xs text-red-700">{err("serviceTimes")}</p>}
|
||||
<Btn className="mt-3" onClick={() => set({ serviceTimes: [...times, { day: "sunday", time: "09:00", label: null, campus: null, note: null }] })}>Add a service time</Btn>
|
||||
</Panel>
|
||||
|
||||
<Panel title="Contact and address">
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<Field label="Email" error={err("contact.email")}><input type="email" className={inputClass} value={c.contact.email ?? ""} onChange={(e) => set({ contact: { ...c.contact, email: e.target.value || null } })} /></Field>
|
||||
<Field label="Phone" hint="With the country code: +27125550123" error={err("contact.phone")}><input className={inputClass} value={c.contact.phone ?? ""} onChange={(e) => set({ contact: { ...c.contact, phone: e.target.value.replace(/\s+/g, "") || null } })} /></Field>
|
||||
<Field label="WhatsApp" hint="With the country code" error={err("contact.whatsapp")}><input className={inputClass} value={c.contact.whatsapp ?? ""} onChange={(e) => set({ contact: { ...c.contact, whatsapp: e.target.value.replace(/\s+/g, "") || null } })} /></Field>
|
||||
<div />
|
||||
<Field label="Street address" error={err("contact.address.line1")}><input className={inputClass} value={address.line1} onChange={(e) => setAddress({ line1: e.target.value })} /></Field>
|
||||
<Field label="Suburb"><input className={inputClass} value={address.suburb ?? ""} onChange={(e) => setAddress({ suburb: e.target.value || null })} /></Field>
|
||||
<Field label="City" error={err("contact.address.city")}><input className={inputClass} value={address.city} onChange={(e) => setAddress({ city: e.target.value })} /></Field>
|
||||
<Field label="Postal code"><input className={inputClass} value={address.postalCode ?? ""} onChange={(e) => setAddress({ postalCode: e.target.value || null })} /></Field>
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
<Panel title="Social links">
|
||||
<ul className="space-y-2">
|
||||
{c.social.map((s, i) => (
|
||||
<li key={i} className="grid gap-2 sm:grid-cols-[12rem_1fr_auto]">
|
||||
<select aria-label="Network" className={inputClass} value={s.network} onChange={(e) => set({ social: c.social.map((x, j) => (j === i ? { ...x, network: e.target.value as Social["network"] } : x)) })}>{NETWORKS.map((n) => <option key={n} value={n}>{n}</option>)}</select>
|
||||
<input aria-label="Address" className={inputClass} value={s.url} onChange={(e) => set({ social: c.social.map((x, j) => (j === i ? { ...x, url: e.target.value } : x)) })} />
|
||||
<Btn kind="danger" onClick={() => set({ social: c.social.filter((_, j) => j !== i) })}>Remove</Btn>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{err("social") && <p className="mt-2 text-xs text-red-700">{err("social")}</p>}
|
||||
<Btn className="mt-3" onClick={() => set({ social: [...c.social, { network: "facebook", url: "https://" }] })}>Add a link</Btn>
|
||||
</Panel>
|
||||
</fieldset>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -3,15 +3,20 @@
|
||||
/**
|
||||
* Simple events (§8): title, date and time, place, description, a photo and an optional link (a
|
||||
* sign-up form elsewhere, say). Registrations and payments are Cross Events'. Each publishes on its
|
||||
* own (decision 9). Events from Cross Events show on the site by themselves once it's linked.
|
||||
* own (decision 9). An event can belong to a ministry: its Ministry leader can add and change it,
|
||||
* and an Editor publishes it (§10). Events from Cross Events show on the site by themselves.
|
||||
*/
|
||||
import { useState } from "react";
|
||||
import { api, canEdit } from "@/admin/api";
|
||||
import { ImagePicker } from "@/admin/media";
|
||||
import { Btn, Field, inputClass, Loading, Notice, Panel, Title, useAction, useAdmin, when } from "@/admin/ui";
|
||||
|
||||
type Ev = { id: string; slug: string; title: string; startsAt: string; endsAt: string | null; allDay: boolean; location: string | null; description: string | null; imageId: string | null; image: string | null; link: string | null; cancelled: boolean; published: boolean };
|
||||
type Form = { title: string; date: string; time: string; endDate: string; endTime: string; allDay: boolean; location: string; description: string; imageId: string | null; link: string };
|
||||
type Ev = {
|
||||
id: string; slug: string; title: string; startsAt: string; endsAt: string | null; allDay: boolean; location: string | null; description: string | null;
|
||||
imageId: string | null; image: string | null; link: string | null; ministryId: string | null; cancelled: boolean; published: boolean; updatedAt: string;
|
||||
};
|
||||
type Form = { title: string; date: string; time: string; endDate: string; endTime: string; allDay: boolean; location: string; description: string; imageId: string | null; link: string; ministryId: string | null };
|
||||
type Me = { user: { role: string; ministryId: string | null } };
|
||||
|
||||
/** "2026-12-05" + "18:30" in the browser's time zone (the church's, for its admins) → ISO with offset. */
|
||||
const iso = (date: string, time: string) => (date ? new Date(`${date}T${time || "00:00"}`).toISOString() : null);
|
||||
@@ -22,7 +27,7 @@ const local = (s: string | null) => {
|
||||
return { d: `${x.getFullYear()}-${p(x.getMonth() + 1)}-${p(x.getDate())}`, t: `${p(x.getHours())}:${p(x.getMinutes())}` };
|
||||
};
|
||||
|
||||
function EventForm({ initial, onSave, onCancel }: { initial: Form; onSave: (body: object) => Promise<unknown>; onCancel: () => void }) {
|
||||
function EventForm({ initial, ministries, fixedMinistry, onSave, onCancel }: { initial: Form; ministries: { id: string; name: string }[]; fixedMinistry: string | null; onSave: (body: object) => Promise<unknown>; onCancel: () => void }) {
|
||||
const [v, setV] = useState(initial);
|
||||
const { busy, message, fields, run } = useAction();
|
||||
const set = (k: keyof Form, x: unknown) => setV({ ...v, [k]: x });
|
||||
@@ -39,11 +44,19 @@ function EventForm({ initial, onSave, onCancel }: { initial: Form; onSave: (body
|
||||
<Field label="Where" error={fields.location}><input className={inputClass} value={v.location} maxLength={500} onChange={(e) => set("location", e.target.value)} /></Field>
|
||||
<Field label="About it" error={fields.description}><textarea className={inputClass} rows={4} value={v.description} maxLength={8000} onChange={(e) => set("description", e.target.value)} /></Field>
|
||||
<Field label="Link (optional)" hint="A sign-up form or more information elsewhere: https://…" error={fields.link}><input className={inputClass} value={v.link} onChange={(e) => set("link", e.target.value)} /></Field>
|
||||
{!fixedMinistry && ministries.length > 0 && (
|
||||
<Field label="Ministry (optional)" hint="Its Ministry leader can then change it too.">
|
||||
<select className={inputClass} value={v.ministryId ?? ""} onChange={(e) => set("ministryId", e.target.value || null)}>
|
||||
<option value="">None</option>
|
||||
{ministries.map((m) => <option key={m.id} value={m.id}>{m.name}</option>)}
|
||||
</select>
|
||||
</Field>
|
||||
)}
|
||||
<ImagePicker label="Photo" value={v.imageId} onChange={(id) => set("imageId", id)} />
|
||||
<div className="flex gap-2">
|
||||
<Btn kind="primary" busy={busy} onClick={() => run(() => onSave({
|
||||
title: v.title, startsAt: iso(v.date, v.allDay ? "00:00" : v.time), endsAt: v.endDate ? iso(v.endDate, v.allDay ? "23:59" : v.endTime) : null,
|
||||
allDay: v.allDay, location: v.location || null, description: v.description || null, imageId: v.imageId, link: v.link || null,
|
||||
allDay: v.allDay, location: v.location || null, description: v.description || null, imageId: v.imageId, link: v.link || null, ministryId: fixedMinistry ?? v.ministryId,
|
||||
}))}>Save</Btn>
|
||||
<Btn onClick={onCancel}>Cancel</Btn>
|
||||
</div>
|
||||
@@ -52,31 +65,41 @@ function EventForm({ initial, onSave, onCancel }: { initial: Form; onSave: (body
|
||||
);
|
||||
}
|
||||
|
||||
const empty: Form = { title: "", date: "", time: "10:00", endDate: "", endTime: "", allDay: false, location: "", description: "", imageId: null, link: "" };
|
||||
const empty: Form = { title: "", date: "", time: "10:00", endDate: "", endTime: "", allDay: false, location: "", description: "", imageId: null, link: "", ministryId: null };
|
||||
|
||||
export default function Events() {
|
||||
const me = useAdmin<{ user: { role: string } }>("/me");
|
||||
const me = useAdmin<Me>("/me");
|
||||
const { data, error, reload } = useAdmin<Ev[]>("/events");
|
||||
const ministries = useAdmin<{ id: string; name: string }[]>("/ministries");
|
||||
const [editing, setEditing] = useState<string | null>(null);
|
||||
const { busy, message, run } = useAction();
|
||||
if (!data || !me.data) return <Loading error={error ?? me.error} />;
|
||||
const editor = canEdit(me.data.user.role);
|
||||
const leaderOf = me.data.user.role === "ministry_leader" ? me.data.user.ministryId : null;
|
||||
const mayWrite = (e: Ev | null) => editor || (!!leaderOf && (!e || e.ministryId === leaderOf));
|
||||
const nameOf = (id: string | null) => ministries.data?.find((m) => m.id === id)?.name;
|
||||
const toForm = (e: Ev): Form => {
|
||||
const s = local(e.startsAt);
|
||||
const f = local(e.endsAt);
|
||||
return { title: e.title, date: s.d, time: s.t, endDate: f.d, endTime: f.t, allDay: e.allDay, location: e.location ?? "", description: e.description ?? "", imageId: e.imageId, link: e.link ?? "" };
|
||||
return { title: e.title, date: s.d, time: s.t, endDate: f.d, endTime: f.t, allDay: e.allDay, location: e.location ?? "", description: e.description ?? "", imageId: e.imageId, link: e.link ?? "", ministryId: e.ministryId };
|
||||
};
|
||||
const state = (e: Ev, change: object, done: string) => run(async () => { await api(`/events/${e.id}/state`, { body: change }); await reload(); }, done);
|
||||
const form = (e: Ev | null) => (
|
||||
<EventForm initial={e ? toForm(e) : { ...empty, ministryId: leaderOf }} ministries={ministries.data ?? []} fixedMinistry={leaderOf} onCancel={() => setEditing(null)}
|
||||
onSave={async (b) => {
|
||||
await api(e ? `/events/${e.id}` : "/events", { method: e ? "PUT" : "POST", body: e ? { ...b, ifUpdatedAt: e.updatedAt } : b });
|
||||
setEditing(null);
|
||||
await reload();
|
||||
}} />
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<Title sub="Simple events made here. Events with registration and payment belong in Cross Events; they show here by themselves once it's linked.">Events</Title>
|
||||
<Title sub={leaderOf ? `You can add and change ${nameOf(leaderOf) ?? "your ministry"}'s events; an editor publishes them.` : "Simple events made here. Events with registration and payment belong in Cross Events; they show here by themselves once it's linked."}>Events</Title>
|
||||
{message && <div className="mb-4"><Notice tone={message.tone}>{message.text}</Notice></div>}
|
||||
<div className="space-y-6">
|
||||
{editor && (
|
||||
{mayWrite(null) && (
|
||||
<Panel title="Add an event">
|
||||
{editing === "new"
|
||||
? <EventForm initial={empty} onCancel={() => setEditing(null)} onSave={async (b) => { await api("/events", { body: b }); setEditing(null); await reload(); }} />
|
||||
: <Btn kind="primary" onClick={() => setEditing("new")}>Add an event</Btn>}
|
||||
{editing === "new" ? form(null) : <Btn kind="primary" onClick={() => setEditing("new")}>Add an event</Btn>}
|
||||
</Panel>
|
||||
)}
|
||||
<Panel title="Your events">
|
||||
@@ -84,23 +107,23 @@ export default function Events() {
|
||||
<ul className="divide-y divide-gray-200">
|
||||
{data.map((e) => (
|
||||
<li key={e.id} className="py-3">
|
||||
{editing === e.id ? (
|
||||
<EventForm initial={toForm(e)} onCancel={() => setEditing(null)} onSave={async (b) => { await api(`/events/${e.id}`, { method: "PUT", body: b }); setEditing(null); await reload(); }} />
|
||||
) : (
|
||||
{editing === e.id ? form(e) : (
|
||||
<div className="flex flex-wrap items-center gap-4">
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="font-medium">{e.title}</p>
|
||||
<p className="text-sm text-gray-600">{when(e.startsAt)}{e.location && ` · ${e.location}`}</p>
|
||||
<p className="text-sm text-gray-600">{when(e.startsAt)}{e.location && ` · ${e.location}`}{e.ministryId && nameOf(e.ministryId) && ` · ${nameOf(e.ministryId)}`}</p>
|
||||
<p className="text-xs">{e.cancelled ? <span className="text-red-700">Cancelled</span> : e.published ? <span className="text-green-800">On the site</span> : <span className="text-gray-500">Not published</span>}</p>
|
||||
</div>
|
||||
{editor && (
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Btn onClick={() => setEditing(e.id)}>Edit</Btn>
|
||||
<Btn busy={busy} onClick={() => state(e, { published: !e.published }, e.published ? "Taken off the site." : "On the site now.")}>{e.published ? "Unpublish" : "Publish"}</Btn>
|
||||
<Btn busy={busy} onClick={() => state(e, { cancelled: !e.cancelled }, e.cancelled ? "Back on." : "Cancelled: it's off the site.")}>{e.cancelled ? "Not cancelled" : "Cancel it"}</Btn>
|
||||
<Btn kind="danger" busy={busy} onClick={() => run(async () => { await api(`/events/${e.id}`, { method: "DELETE" }); await reload(); }, "Removed.")}>Remove</Btn>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{mayWrite(e) && <Btn onClick={() => setEditing(e.id)}>Edit</Btn>}
|
||||
{editor && (
|
||||
<>
|
||||
<Btn busy={busy} onClick={() => state(e, { published: !e.published }, e.published ? "Taken off the site." : "On the site now.")}>{e.published ? "Unpublish" : "Publish"}</Btn>
|
||||
<Btn busy={busy} onClick={() => state(e, { cancelled: !e.cancelled }, e.cancelled ? "Back on." : "Cancelled: it's off the site.")}>{e.cancelled ? "Not cancelled" : "Cancel it"}</Btn>
|
||||
<Btn kind="danger" busy={busy} onClick={() => run(async () => { await api(`/events/${e.id}`, { method: "DELETE" }); await reload(); }, "Removed.")}>Remove</Btn>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</li>
|
||||
|
||||
@@ -10,6 +10,7 @@ type Overview = {
|
||||
storage: Storage;
|
||||
colourNotes: string[];
|
||||
checklist: { key: string; label: string; done: boolean; href: string | null }[];
|
||||
recent: { at: string; who: string; action: string; detail: string | null }[];
|
||||
};
|
||||
|
||||
/** The dashboard (§10): the setup checklist, what's waiting to be published, storage. */
|
||||
@@ -37,6 +38,13 @@ export default function Dashboard() {
|
||||
<p>{data.pending} {data.pending === 1 ? "change" : "changes"}. <Link href="/admin/publish" className="font-semibold text-brand-text underline-offset-4 hover:underline">Review and publish</Link></p>
|
||||
) : <p className="text-gray-600">Nothing: the site shows everything you've done.</p>}
|
||||
</Panel>
|
||||
<Panel title="Recent edits">
|
||||
{data.recent.length === 0 ? <p className="text-gray-600">None yet.</p> : (
|
||||
<ul className="space-y-2 text-sm">
|
||||
{data.recent.map((e, i) => <li key={i}><span className="font-medium">{e.who}</span> {e.action.charAt(0).toLowerCase() + e.action.slice(1)}{e.detail && <>: {e.detail}</>} <span className="text-gray-500">({when(e.at)})</span></li>)}
|
||||
</ul>
|
||||
)}
|
||||
</Panel>
|
||||
<Panel title="Storage"><StorageMeter s={data.storage} /></Panel>
|
||||
{data.colourNotes.length > 0 && (
|
||||
<Notice tone="info"><p className="font-semibold">About your colours</p><ul className="mt-1 list-disc pl-5">{data.colourNotes.map((n) => <li key={n}>{n}</li>)}</ul></Notice>
|
||||
|
||||
@@ -12,8 +12,8 @@ import { BLOCK_FIELDS, DataForm, SECTION_FIELDS } from "@/admin/fields";
|
||||
import { ImagePicker } from "@/admin/media";
|
||||
import { Btn, Field, inputClass, Loading, Notice, Panel, Title, useAction, useAdmin } from "@/admin/ui";
|
||||
|
||||
type Section = { id: string; type: string; variant: string | null; hidden: boolean; data: Record<string, unknown> };
|
||||
type PageData = { id: string; kind: string; slug: string; title: string; seoTitle: string | null; description: string | null; navLabel: string | null; inNav: boolean; imageId: string | null; sections: Section[] };
|
||||
type Section = { id: string; type: string; variant: string | null; hidden: boolean; data: Record<string, unknown>; updatedAt: string };
|
||||
type PageData = { id: string; kind: string; slug: string; title: string; seoTitle: string | null; description: string | null; navLabel: string | null; inNav: boolean; imageId: string | null; updatedAt: string; sections: Section[] };
|
||||
|
||||
const HOME_ORDER = ["hero", "serviceTimes", "welcome", "ministries", "team", "events", "latestMessage", "invitation"];
|
||||
const LISTS: Record<string, string> = {
|
||||
@@ -55,7 +55,7 @@ export default function EditPage() {
|
||||
if (!page) return <Loading error={error} />;
|
||||
const f = { ...page, ...form };
|
||||
const saveDetails = () => details.run(async () => {
|
||||
const p = await api<PageData>(`/pages/${id}`, { method: "PUT", body: { title: f.title, slug: f.slug, seoTitle: f.seoTitle, description: f.description, navLabel: f.navLabel, inNav: f.inNav, imageId: f.imageId } });
|
||||
const p = await api<PageData>(`/pages/${id}`, { method: "PUT", body: { title: f.title, slug: f.slug, seoTitle: f.seoTitle, description: f.description, navLabel: f.navLabel, inNav: f.inNav, imageId: f.imageId, ifUpdatedAt: page.updatedAt } });
|
||||
setData(p);
|
||||
setForm(null);
|
||||
}, "Saved as a draft.");
|
||||
@@ -97,7 +97,7 @@ export default function EditPage() {
|
||||
{HOME_ORDER.map((type) => {
|
||||
const s = page.sections.find((x) => x.type === type);
|
||||
const spec = SECTION_FIELDS[type]!;
|
||||
return <SectionEditor key={type} title={spec.name} fields={spec.fields} initial={s?.data ?? {}} onSave={async (data) => setData(await api<PageData>(`/pages/${id}/home/${type}`, { method: "PUT", body: { data } }))} />;
|
||||
return <SectionEditor key={type} title={spec.name} fields={spec.fields} initial={s?.data ?? {}} onSave={async (data) => setData(await api<PageData>(`/pages/${id}/home/${type}`, { method: "PUT", body: { data, ifUpdatedAt: s?.updatedAt } }))} />;
|
||||
})}
|
||||
</>
|
||||
) : (
|
||||
@@ -108,7 +108,7 @@ export default function EditPage() {
|
||||
if (!spec) return null;
|
||||
return (
|
||||
<SectionEditor key={s.id} title={`${spec.name}${s.hidden ? " (hidden)" : ""}`} fields={spec.fields} initial={s.data}
|
||||
onSave={async (data) => setData(await api<PageData>(`/pages/${id}/blocks/${s.id}`, { method: "PUT", body: { data } }))}
|
||||
onSave={async (data) => setData(await api<PageData>(`/pages/${id}/blocks/${s.id}`, { method: "PUT", body: { data, ifUpdatedAt: s.updatedAt } }))}
|
||||
extra={<>
|
||||
<Btn onClick={() => blockCall(`/blocks/${s.id}/move`, "POST", { direction: "up" })} disabled={i === 0} aria-label="Move up">↑</Btn>
|
||||
<Btn onClick={() => blockCall(`/blocks/${s.id}/move`, "POST", { direction: "down" })} disabled={i === page.sections.length - 1} aria-label="Move down">↓</Btn>
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
"use client";
|
||||
|
||||
/**
|
||||
* Settings (§10): the Coming soon line, search engine verification (live at once), and the menu's
|
||||
* order (a draft, published with the site).
|
||||
*/
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
import { api, canEdit } from "@/admin/api";
|
||||
import { Btn, Field, inputClass, Loading, Notice, Panel, Title, useAction, useAdmin } from "@/admin/ui";
|
||||
|
||||
type Settings = { comingSoonText: string; googleVerification: string | null; bingVerification: string | null };
|
||||
type PageRow = { id: string; kind: string; title: string; inNav: boolean };
|
||||
|
||||
export default function SettingsPage() {
|
||||
const me = useAdmin<{ user: { role: string } }>("/me");
|
||||
const settings = useAdmin<Settings>("/settings");
|
||||
const pages = useAdmin<PageRow[]>("/pages");
|
||||
const [form, setForm] = useState<Partial<Settings>>({});
|
||||
const { busy, message, fields, run } = useAction();
|
||||
if (!settings.data || !pages.data || !me.data) return <Loading error={settings.error ?? pages.error} />;
|
||||
const editor = canEdit(me.data.user.role);
|
||||
const s = { ...settings.data, ...form };
|
||||
const menu = pages.data.filter((p) => p.kind !== "home");
|
||||
const move = (i: number, d: -1 | 1) => run(async () => {
|
||||
const list = [...menu];
|
||||
[list[i], list[i + d]] = [list[i + d]!, list[i]!];
|
||||
await api("/pages-order", { method: "PUT", body: { ids: list.map((p) => p.id) } });
|
||||
await pages.reload();
|
||||
}, "Saved as a draft: publish to change the menu.");
|
||||
return (
|
||||
<>
|
||||
<Title sub="How your site is found, and its menu.">Settings</Title>
|
||||
{message && <div className="mb-4"><Notice tone={message.tone}>{message.text}</Notice></div>}
|
||||
<fieldset disabled={!editor} className="space-y-6">
|
||||
<Panel title="Search engines">
|
||||
<p className="mb-3 text-sm text-gray-600">To see how people find your site, add it to Google Search Console and Bing Webmaster Tools. They give you a code to prove the site is yours: paste it here (the whole tag is fine), save, then press Verify there. This goes live straight away.</p>
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<Field label="Google Search Console code" error={fields.googleVerification}><input className={inputClass} value={s.googleVerification ?? ""} onChange={(e) => setForm({ ...form, googleVerification: e.target.value })} /></Field>
|
||||
<Field label="Bing Webmaster Tools code" error={fields.bingVerification}><input className={inputClass} value={s.bingVerification ?? ""} onChange={(e) => setForm({ ...form, bingVerification: e.target.value })} /></Field>
|
||||
</div>
|
||||
<p className="mt-3 text-sm text-gray-600">A Google Business Profile helps people find your church on Google Maps: set one up at business.google.com with the same address as your church details.</p>
|
||||
</Panel>
|
||||
<Panel title="Coming soon">
|
||||
<Field label="The line under “Coming soon”" hint="Shown until you first publish your site." error={fields.comingSoonText}>
|
||||
<input className={inputClass} value={s.comingSoonText} maxLength={300} onChange={(e) => setForm({ ...form, comingSoonText: e.target.value })} />
|
||||
</Field>
|
||||
</Panel>
|
||||
{editor && Object.keys(form).length > 0 && (
|
||||
<Btn kind="primary" busy={busy} onClick={() => run(async () => { settings.setData(await api<Settings>("/settings", { method: "PUT", body: form })); setForm({}); }, "Saved.")}>Save settings</Btn>
|
||||
)}
|
||||
<Panel title="Menu order">
|
||||
<p className="mb-3 text-sm text-gray-600">Pages in the menu, in this order. Which pages show is set on each page (<Link href="/admin/pages" className="underline">Pages</Link>).</p>
|
||||
<ul className="divide-y divide-gray-200">
|
||||
{menu.map((p, i) => (
|
||||
<li key={p.id} className="flex items-center justify-between gap-3 py-2">
|
||||
<span>{p.title}{!p.inNav && <span className="text-sm text-gray-500"> (not in the menu)</span>}</span>
|
||||
<span className="flex gap-1">
|
||||
<Btn onClick={() => move(i, -1)} disabled={busy || i === 0} aria-label={`Move ${p.title} up`}>↑</Btn>
|
||||
<Btn onClick={() => move(i, 1)} disabled={busy || i === menu.length - 1} aria-label={`Move ${p.title} down`}>↓</Btn>
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</Panel>
|
||||
</fieldset>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -64,12 +64,16 @@ export default function TemplatePage() {
|
||||
<Panel title="Template">
|
||||
<div className="grid gap-3 sm:grid-cols-2">
|
||||
{TEMPLATES.map((t) => (
|
||||
<button key={t.id} type="button" disabled={busy} onClick={() => t.id !== design.template && save({ template: t.id }, `Switched to ${t.name}. Your own choices are kept; the rest moved to ${t.name}'s defaults.`)}
|
||||
aria-pressed={t.id === design.template}
|
||||
className={cx("rounded-lg border-2 p-4 text-left", t.id === design.template ? "border-brand bg-brand-tint" : "border-gray-200 hover:border-gray-400")}>
|
||||
<div key={t.id} className={cx("rounded-lg border-2 p-4", t.id === design.template ? "border-brand bg-brand-tint" : "border-gray-200")}>
|
||||
<span className="block font-semibold">{t.name}{t.id === design.template && " (in use)"}</span>
|
||||
<span className="mt-1 block text-sm text-gray-600">{t.text}</span>
|
||||
</button>
|
||||
{t.id !== design.template && (
|
||||
<div className="mt-3 flex flex-wrap gap-2">
|
||||
<a href={`/preview/start?template=${t.id}`} className="rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm font-semibold hover:bg-gray-50">Preview with your content</a>
|
||||
<Btn busy={busy} onClick={() => save({ template: t.id }, `Switched to ${t.name}. Your own choices are kept; the rest moved to ${t.name}'s defaults.`)}>Use {t.name}</Btn>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</Panel>
|
||||
|
||||
@@ -2,21 +2,26 @@ import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { loadPublished } from "@/site/load";
|
||||
import { fmtDate, fmtTime, Img } from "@/site/parts";
|
||||
import { siteBase } from "@/site/meta";
|
||||
import { breadcrumbLd, eventLd, shareImage, siteBase } from "@/site/meta";
|
||||
import { Shell } from "@/site/Shell";
|
||||
|
||||
type Props = { params: Promise<{ slug: string }> };
|
||||
|
||||
async function find(slug: string) {
|
||||
const site = await loadPublished();
|
||||
const event = site?.events.find((e) => e.from === "website" && e.url === `/events/${slug}`) ?? null;
|
||||
const event = site?.events.find((e) => e.from === "website" && e.slug === slug) ?? null;
|
||||
return { site, event };
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { site, event } = await find((await params).slug);
|
||||
if (!site || !event) return { robots: { index: false } };
|
||||
return { metadataBase: siteBase(site), title: event.title, description: event.summary ?? undefined, alternates: { canonical: event.url } };
|
||||
const path = `/events/${event.slug}`;
|
||||
const image = event.image && !event.image.url.endsWith(".svg") ? { url: event.image.url, alt: event.image.alt } : { url: shareImage(event.title), width: 1200, height: 630, alt: event.title };
|
||||
return {
|
||||
metadataBase: siteBase(site), title: event.title, description: event.summary ?? undefined, alternates: { canonical: path },
|
||||
openGraph: { type: "website", title: event.title, description: event.summary ?? undefined, url: path, images: [image] }, twitter: { card: "summary_large_image" },
|
||||
};
|
||||
}
|
||||
|
||||
/** A simple event made in the Website (§8). Cross Events' own events link to Cross Events instead. */
|
||||
@@ -25,8 +30,11 @@ export default async function EventPage({ params }: Props) {
|
||||
if (!site || !event) notFound();
|
||||
const zone = site.church?.timezone ?? "Africa/Johannesburg";
|
||||
const events = site.snapshot.pages.find((p) => p.kind === "events");
|
||||
const path = `/events/${event.slug}`;
|
||||
const lds = [eventLd(site, { ...event, url: path }), breadcrumbLd(site, [...(events ? [{ name: events.title, path: events.path }] : []), { name: event.title, path }])];
|
||||
return (
|
||||
<Shell site={site} path={event.url}>
|
||||
<Shell site={site} path={path}>
|
||||
{lds.map((ld, i) => <script key={i} type="application/ld+json" dangerouslySetInnerHTML={{ __html: ld }} />)}
|
||||
<article className="cc-section">
|
||||
<div className="cc-wrap grid gap-10 md:grid-cols-2">
|
||||
<Img image={event.image} priority />
|
||||
@@ -35,7 +43,8 @@ export default async function EventPage({ params }: Props) {
|
||||
<h1 className="cc-h1 mt-2">{event.title}</h1>
|
||||
{event.location && <p className="cc-muted mt-3 text-lg">{event.location}</p>}
|
||||
{event.summary && <p className="cc-prose mt-6">{event.summary}</p>}
|
||||
{events && <a href={events.path} className="cc-link mt-8 inline-block font-semibold">All events</a>}
|
||||
{event.link && <a href={event.link} rel="noopener" className="cc-btn mt-8">More information</a>}
|
||||
{events && <a href={events.path} className="cc-link mt-8 block font-semibold">All events</a>}
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -13,7 +13,10 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
return { title: { absolute: c.church ? `${c.church.name}: coming soon` : "Coming soon" }, robots: { index: false, follow: true } };
|
||||
}
|
||||
const home = c.snapshot.pages.find((p) => p.kind === "home");
|
||||
return home ? pageMetadata(c, home) : {};
|
||||
// Search Console and Bing Webmaster Tools look for their code on the home page (Settings).
|
||||
const v = c.verification;
|
||||
const verification = v && (v.google || v.bing) ? { verification: { ...(v.google ? { google: v.google } : {}), ...(v.bing ? { other: { "msvalidate.01": v.bing } } : {}) } } : {};
|
||||
return home ? { ...pageMetadata(c, home), ...verification } : verification;
|
||||
}
|
||||
|
||||
export default async function Home() {
|
||||
|
||||
@@ -3,8 +3,10 @@ import { NextResponse, type NextRequest } from "next/server";
|
||||
/** Leaves the preview: an admin goes back to editing, someone with a shared link to the live site. */
|
||||
export function GET(request: NextRequest) {
|
||||
const admin = request.cookies.get("ccw_preview")?.value === "admin";
|
||||
const to = admin ? (request.nextUrl.searchParams.get("published") ? "/admin/publish" : "/admin") : "/";
|
||||
const trying = !!request.cookies.get("ccw_preview_template")?.value;
|
||||
const to = admin ? (request.nextUrl.searchParams.get("published") ? "/admin/publish" : trying ? "/admin/template" : "/admin") : "/";
|
||||
const res = NextResponse.redirect(new URL(to, request.url), 303);
|
||||
res.cookies.delete("ccw_preview");
|
||||
res.cookies.delete("ccw_preview_template");
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,11 @@ import { NextResponse, type NextRequest } from "next/server";
|
||||
*/
|
||||
export function GET(request: NextRequest) {
|
||||
const res = NextResponse.redirect(new URL("/", request.url), 303);
|
||||
res.cookies.set("ccw_preview", "admin", { httpOnly: true, sameSite: "lax", secure: process.env.NODE_ENV === "production", path: "/" });
|
||||
const opts = { httpOnly: true, sameSite: "lax" as const, secure: process.env.NODE_ENV === "production", path: "/" };
|
||||
res.cookies.set("ccw_preview", "admin", opts);
|
||||
// "Choose your template": the church's own content in another template, nothing saved.
|
||||
const template = request.nextUrl.searchParams.get("template");
|
||||
if (template && /^(heritage|bold|community|clean)$/.test(template)) res.cookies.set("ccw_preview_template", template, opts);
|
||||
else res.cookies.delete("ccw_preview_template");
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { ImageResponse } from "next/og";
|
||||
import type { NextRequest } from "next/server";
|
||||
import { loadContent } from "@/site/load";
|
||||
|
||||
/**
|
||||
* The share image for a page without its own (ROADMAP-v3 §11: "Pages without their own image get a
|
||||
* share image generated from the church's logo and colours"): 1200 × 630, the church's colour, its
|
||||
* name and the page's title. `?t=` is the title (only shown, never trusted for anything else).
|
||||
*/
|
||||
export async function GET(request: NextRequest) {
|
||||
const c = await loadContent();
|
||||
const title = (request.nextUrl.searchParams.get("t") ?? "").slice(0, 90);
|
||||
const name = c.church?.name ?? "Our church";
|
||||
const rgb = (triple: string) => `rgb(${triple.split(" ").join(",")})`;
|
||||
const logo = c.church?.branding.logoUrl;
|
||||
return new ImageResponse(
|
||||
(
|
||||
<div style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column", justifyContent: "space-between", padding: 72, background: rgb(c.palette.brand), color: rgb(c.palette.onBrand) }}>
|
||||
<div style={{ display: "flex", alignItems: "center", gap: 24 }}>
|
||||
{logo && /^https:\/\//.test(logo) && !logo.endsWith(".svg") ? <img src={logo} alt="" height={88} style={{ borderRadius: 12, background: "white", padding: 8 }} /> : null}
|
||||
<div style={{ fontSize: 40, fontWeight: 700 }}>{name}</div>
|
||||
</div>
|
||||
<div style={{ display: "flex", fontSize: title.length > 40 ? 64 : 80, fontWeight: 800, lineHeight: 1.1 }}>{title || name}</div>
|
||||
<div style={{ display: "flex", height: 12, width: 220, background: rgb(c.palette.accent), borderRadius: 6 }} />
|
||||
</div>
|
||||
),
|
||||
{ width: 1200, height: 630, headers: { "Cache-Control": "public, max-age=3600" } },
|
||||
);
|
||||
}
|
||||
@@ -14,6 +14,6 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
const at = (path: string) => new URL(path, base).toString();
|
||||
return [
|
||||
...c.snapshot.pages.map((p) => ({ url: at(p.path), changeFrequency: "weekly" as const, priority: p.kind === "home" ? 1 : 0.7 })),
|
||||
...c.events.filter((e) => e.from === "website" && e.url.startsWith("/")).map((e) => ({ url: at(e.url), changeFrequency: "weekly" as const, priority: 0.5 })),
|
||||
...c.events.filter((e) => e.from === "website" && e.slug).map((e) => ({ url: at(`/events/${e.slug}`), changeFrequency: "weekly" as const, priority: 0.5 })),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user