公开页补齐自引用 Canonical 与按类型的结构化数据,图片补上说明文字。

后台设置和内容编辑改成可导航布局;部署用访客 origin 生成 Canonical,避免落到容器地址。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-20 00:11:24 +08:00
parent 2b3d122e56
commit 40bbad2c82
51 changed files with 3042 additions and 1318 deletions

View File

@@ -17,6 +17,9 @@ import {
SiteDocMasthead,
SiteDocBreadcrumb,
} from "@/components/site-doc";
import { requestCanonical } from "@/lib/canonicalMeta";
import { webPageJsonLd } from "@/lib/jsonLd";
import JsonLd from "@/components/JsonLd";
interface PageProps {
params: Promise<{ slug: string }>;
@@ -36,6 +39,7 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
type: "article",
publishedTime: p.created_at,
},
...(await requestCanonical(`/p/${p.slug}`)),
};
}
@@ -70,14 +74,13 @@ export default async function SitePagePublic({ params }: PageProps) {
);
};
const jsonLd = {
"@context": "https://schema.org",
"@type": "WebPage",
const jsonLd = webPageJsonLd({
name: p.title,
description: p.excerpt || undefined,
path: `/p/${p.slug}`,
datePublished: p.created_at,
dateModified: p.updated_at,
};
});
const left = (
<>
@@ -99,10 +102,7 @@ export default async function SitePagePublic({ params }: PageProps) {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<JsonLd data={jsonLd} />
<SiteDocShell
left={left}