公开页补齐自引用 Canonical 与按类型的结构化数据,图片补上说明文字。
后台设置和内容编辑改成可导航布局;部署用访客 origin 生成 Canonical,避免落到容器地址。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
12
frontend/components/JsonLd.tsx
Normal file
12
frontend/components/JsonLd.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { serializeJsonLd } from "@/lib/jsonLd";
|
||||
|
||||
/** 服务端输出单个 application/ld+json,不在客户端补脚本 */
|
||||
export default function JsonLd({ data }: { data: Record<string, unknown> | null }) {
|
||||
if (!data) return null;
|
||||
return (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: serializeJsonLd(data) }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user