fff77dac3f
Add liuyao/bazi/combined flows with shared calc and AI infrastructure, 64-gua learn routes, and update Ubuntu PM2 deployment docs for port 3130. Co-authored-by: Cursor <cursoragent@cursor.com>
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import Link from "next/link";
|
|
import { notFound } from "next/navigation";
|
|
import PageShell from "@/components/page-shell";
|
|
import GuaFooter from "@/components/learn/gua-footer";
|
|
import MarkdownContent from "@/components/learn/markdown-content";
|
|
import {
|
|
getGuaName,
|
|
getGuaNumber,
|
|
listGuaMarks,
|
|
readLearnMarkdown,
|
|
stripFrontmatter,
|
|
} from "@/lib/content/zhouyi";
|
|
|
|
export async function generateStaticParams() {
|
|
const marks = await listGuaMarks("traditional");
|
|
return marks.map((guaMark) => ({ guaMark }));
|
|
}
|
|
|
|
export default async function GuaDetailPage({
|
|
params,
|
|
}: {
|
|
params: Promise<{ guaMark: string }>;
|
|
}) {
|
|
const { guaMark } = await params;
|
|
const marks = await listGuaMarks("traditional");
|
|
if (!marks.includes(guaMark)) {
|
|
notFound();
|
|
}
|
|
|
|
const raw = await readLearnMarkdown(guaMark, "traditional");
|
|
const content = stripFrontmatter(raw);
|
|
|
|
return (
|
|
<PageShell className="max-w-3xl px-4 py-8">
|
|
<div className="mb-6 text-sm text-muted-foreground">
|
|
<Link href="/learn" className="hover:text-foreground">
|
|
← 返回总览
|
|
</Link>
|
|
</div>
|
|
<div className="mb-4 text-sm text-muted-foreground">
|
|
第 {getGuaNumber(guaMark)} 卦 · {getGuaName(guaMark)}
|
|
</div>
|
|
<MarkdownContent content={content} variant="traditional" />
|
|
<GuaFooter guaMark={guaMark} />
|
|
</PageShell>
|
|
);
|
|
}
|