feat: add metadata generator for remaining books
This commit is contained in:
@@ -1,11 +1,25 @@
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getOtherDocumentMeta, slugToBookCode } from "@/lib/other-documents";
|
||||
import { ogForOtherDocument } from "@/lib/og";
|
||||
import { PageHeader } from "@/components/page-header";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ slug: string }>;
|
||||
}): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const bookCode = slugToBookCode(slug);
|
||||
const meta = await getOtherDocumentMeta(bookCode);
|
||||
const title = meta?.title ?? slug;
|
||||
return ogForOtherDocument(title);
|
||||
}
|
||||
|
||||
export default async function OtherDocumentIndexPage({
|
||||
params,
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user