Add per-page search metadata, link previews and a sitemap

Page requests now go through the API (routes/pages.js), which fills
the built index.html in for that path before the app loads: title,
description, preview image, canonical URL, and structured data
(Organization, Event, BlogPosting). Shared links preview the page
itself. Unlisted records are noindex; missing ones return 404.
/sitemap.xml lists every public, listed page.

site.json is the one place for the site's name, address, default
description and preview image, and each static page's title and
intro, which the pages now read too. Indexing is switched on:
robots.txt allows all but /admin and /api and names the sitemap. The
browser tab title follows the page.

nginx setup, with a fallback to the plain page if the API is down,
is in docs/seo.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-27 21:21:10 -05:00
parent 71a470b66f
commit 64cb2ec56a
21 changed files with 777 additions and 29 deletions

View file

@ -1,4 +1,5 @@
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
import { useSectionManifest } from "../lib/sections.tsx";
import OrgListMap, { OrgMapToggle } from "./sections/OrgList-Map.tsx";
import OrgListVertical from "./sections/OrgList-Vertical.tsx";
@ -6,6 +7,9 @@ import OrgListCards from "./sections/OrgList-Card.tsx";
import CommunityBlog from "./sections/CommunityBlog.tsx";
import { useCommunityBlog } from "../lib/useBlog.ts";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/community");
/* ═══════════════════════════════════════════════════════════════
COMMUNITY PAGE
@ -82,8 +86,8 @@ export default function CommunityPage() {
return (
<PageShell
title="Community"
intro="Chapters, regions and the people who make up Next Generation of Unity."
title={PAGE.title}
intro={PAGE.description}
sections={sections}
/>
);

View file

@ -1,6 +1,10 @@
import PageShell from "../components/PageShell";
import { sitePage } from "../lib/site.ts";
import FeedbackForm from "./sections/FeedbackForm";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/feedback");
/* ═══════════════════════════════════════════════════════════════
Feedback page.
@ -36,8 +40,8 @@ const SECTIONS = [
export default function Feedback() {
return (
<PageShell
title="Feedback"
intro="Tell us what's working, what isn't, and what you'd like to see next."
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);

View file

@ -1,5 +1,9 @@
import { useEffect } from "react";
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/give");
const GIVING_URL =
"https://ngu.churchcenteronline.com/giving?open-in-church-center-modal=true";
@ -81,8 +85,8 @@ export default function GivingPage() {
return (
<PageShell
title="Giving"
intro="Support the work of Next Generation of Unity."
title={PAGE.title}
intro={PAGE.description}
sections={sections}
/>
);

View file

@ -1,8 +1,12 @@
import PageShell from "../components/PageShell";
import { sitePage } from "../lib/site.ts";
import HistoryTimeline from "./sections/history/HistoryTimeline";
import { HISTORY_DECADES } from "../data/historyDecades";
import { useHistory } from "../lib/useHistory";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/history");
/**
* Year the program starts. Decades ending before this render with the
* pre-program treatment, so the gap moves if the founding date is ever
@ -66,8 +70,8 @@ export default function History() {
return (
<PageShell
title="History"
intro="A near-complete timeline of Next Generation of Unity (NGU), and other Unity Young Adult programs."
title={PAGE.title}
intro={PAGE.description}
sections={[
{
id: "timeline",

View file

@ -23,7 +23,7 @@
broken server.
═══════════════════════════════════════════════════════════════ */
import type { ReactNode } from 'react'
import { useEffect, type ReactNode } from 'react'
import HeroStage from './sections/home/HeroStage.tsx'
import NextEventCountdown from './sections/home/NextEventCountdown.tsx'
@ -33,6 +33,7 @@ import StatsBand from './sections/home/StatsBand.tsx'
import FeaturedBand from './sections/home/FeaturedBand.tsx'
import FeaturedTimelineRail from './sections/home/FeaturedTimelineRail.tsx'
import Pathfinder from './sections/home/Pathfinder.tsx'
import { documentTitle } from '../lib/site.ts'
import {
useFrontPage,
type FrontPage,
@ -104,6 +105,11 @@ const SECTIONS: Record<
export default function Home() {
const { data: page, error, reload } = useFrontPage()
// Back to the site name when a visitor returns here from a page.
useEffect(() => {
document.title = documentTitle()
}, [])
return (
<>
<HeroStage hero={page?.hero ?? null} />

View file

@ -1,6 +1,10 @@
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
import PeopleTiles from "../components/PeopleTiles.tsx";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/leadership");
const SECTIONS = [
{
id: "board-staff",
@ -61,8 +65,8 @@ const SECTIONS = [
export default function Leadership() {
return (
<PageShell
title="Leadership"
intro="The board, staff, and volunteers who keep Next Generation of Unity running."
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);

View file

@ -1,4 +1,8 @@
import PageShell from "../components/PageShell.jsx";
import { sitePage } from "../lib/site.ts";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/privacy");
const SECTIONS = [
{
@ -18,8 +22,8 @@ const SECTIONS = [
export default function PrivacyPage() {
return (
<PageShell
title="Privacy Policy"
intro="How Next Generation of Unity collects, uses, and protects your information."
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);

View file

@ -1,6 +1,10 @@
import PageShell from '../components/PageShell.tsx'
import { sitePage } from '../lib/site.ts'
import QrCodeMaker from './sections/QrCodeMaker.tsx'
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage('/qr')
/* ═══════════════════════════════════════════════════════════════
QR CODES PAGE: /qr
@ -29,8 +33,8 @@ const SECTIONS = [
export default function QrCodes() {
return (
<PageShell
title="QR Codes"
intro="Codes for flyers, slides and signs, pointing at any page on the site."
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
)

View file

@ -1,4 +1,8 @@
import PageShell from "../components/PageShell.jsx";
import { sitePage } from "../lib/site.ts";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/resources");
const SECTIONS = [
{
@ -42,8 +46,8 @@ const SECTIONS = [
export default function ResourcesPage() {
return (
<PageShell
title="Resources"
intro="Teachings, brand assets, and material for chapters and partners."
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);

View file

@ -1,7 +1,11 @@
import PageShell from "../components/PageShell.tsx";
import { sitePage } from "../lib/site.ts";
import { useSectionManifest } from "../lib/sections.tsx";
import EventListCards, { EventCardsToggle } from "./sections/EventList-Cards.tsx";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/retreats");
/* ═══════════════════════════════════════════════════════════════
RETREATS PAGE
@ -112,8 +116,8 @@ export default function RetreatsPage() {
return (
<PageShell
title="Retreats"
intro="Retreats hosted by Next Generation of Unity, our regions, and our partners throughout the year."
title={PAGE.title}
intro={PAGE.description}
sections={sections}
/>
);

View file

@ -1,4 +1,8 @@
import PageShell from "../components/PageShell.jsx";
import { sitePage } from "../lib/site.ts";
/* Title and intro: site.json, which also gives the search metadata. */
const PAGE = sitePage("/terms");
const SECTIONS = [
{
@ -18,8 +22,8 @@ const SECTIONS = [
export default function TermsPage() {
return (
<PageShell
title="Terms of Service"
intro="The terms that apply when you use this site and our programs."
title={PAGE.title}
intro={PAGE.description}
sections={SECTIONS}
/>
);