export const dynamic = "force-dynamic"; import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { getSsrMeta, getSsrIntroSegments } from "@/lib/ssr"; import { ogForBook } from "@/lib/og"; import { PageHeader } from "@/components/layout/page-header"; import { JsonLd } from "@/components/seo/json-ld"; import { bookJsonLd } from "@/lib/jsonld"; import { Card, CardContent } from "@/components/ui/card"; export function generateMetadata(): Metadata { return ogForBook("ssr"); } export default async function SsrPage() { const meta = await getSsrMeta(); if (!meta) notFound(); const introSegments = await getSsrIntroSegments(); // Split intro segments into front matter (before chapters) and back matter (after) const frontMatter = introSegments.filter((seg) => seg.order < 99); const backMatter = introSegments.filter((seg) => seg.order >= 99); return (
← Books

{meta.title}

{meta.author}

{/* Description */} {meta.description && (

{meta.description}

)} {/* Front Matter */} {frontMatter.length > 0 && (

Front Matter

    {frontMatter.map((seg) => (
  • {seg.title}

  • ))}
)} {/* Chapters — hierarchical parent → sub-chapter structure */} {meta.chapters.map((ch) => (

{ch.number}. {ch.title}

    {ch.subChapters.map((sub) => (
  • {sub.title}

  • ))}
))} {/* Back Matter (About the Author) */} {backMatter.length > 0 && (

Back Matter

    {backMatter.map((seg) => (
  • {seg.title}

  • ))}
)}
); }