59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Suspense } from "react";
|
|
|
|
import { PageLoading } from "@/components/common/page-loading";
|
|
import { HelpPage } from "@/components/help/help-page";
|
|
import { HELP_RICHTEXT_TITLES, loadRichTextFirst } from "@/components/richtext/load-richtext";
|
|
import { JsonLd } from "@/components/seo/json-ld";
|
|
import { buildWebPageJSONLD, getHomeBaseSEOCached, mergeSEO, resolvePageMetadata } from "@/lib/seo";
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
const data = await loadRichTextFirst([...HELP_RICHTEXT_TITLES]);
|
|
return resolvePageMetadata({
|
|
seoInfo: mergeSEO(data?.seoInfo, {
|
|
title: "帮助中心",
|
|
description:
|
|
data?.seoInfo?.description?.trim() ||
|
|
data?.desc?.trim() ||
|
|
"查看海角社区常见问题、播放帮助与客服支持信息。",
|
|
}),
|
|
canonical: "/help",
|
|
});
|
|
}
|
|
|
|
async function HelpRouteContent() {
|
|
const data = await loadRichTextFirst([...HELP_RICHTEXT_TITLES]);
|
|
const siteSeo = await getHomeBaseSEOCached();
|
|
const seo = mergeSEO(data?.seoInfo, siteSeo.seo);
|
|
return (
|
|
<>
|
|
<JsonLd
|
|
data={buildWebPageJSONLD({
|
|
path: "/help",
|
|
title: seo.title || "帮助中心",
|
|
description:
|
|
seo.description ||
|
|
data?.desc ||
|
|
data?.title ||
|
|
"查看海角社区常见问题、播放帮助与客服支持信息。",
|
|
type: "WebPage",
|
|
breadcrumbs: [
|
|
["首页", "/"],
|
|
["帮助中心", "/help"],
|
|
],
|
|
siteName: siteSeo.siteName,
|
|
})}
|
|
/>
|
|
<HelpPage data={data} />
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default function Page() {
|
|
return (
|
|
<Suspense fallback={<PageLoading />}>
|
|
<HelpRouteContent />
|
|
</Suspense>
|
|
);
|
|
}
|