编辑元数据 / Edit Your Metadata
需要编辑的文件 / File to Edit
需要更新的字段 / Fields to Update
打开app/layout.tsx,找到 metadata 导出对象,更新以下字段:
Open app/layout.tsx, locate the metadata export object, and update these fields:
元数据结构示例 / Example Metadata Structure
以下是基于 Next.js App Router 规范的完整示例,直接替换各字段的占位值即可: The following is a complete example based on the Next.js App Router pattern. Replace the placeholder values with your own:The Living Index 当前使用服务端首屏双语 metadata,客户端根据用户语言选择动态更新
<title> 和 <meta name="description">。在 app/layout.tsx 中设置的值会作为服务端渲染的基础值,也是社交平台爬虫看到的版本。The Living Index uses server-rendered bilingual metadata on first load. The client updates <title> and <meta name="description"> dynamically based on the user’s language selection. The values you set in app/layout.tsx serve as the server-rendered baseline and are what social platform crawlers see.部署到自定义域名后 / After Deploying to a Custom Domain
将站点部署到自定义域名后,还需要补充以下元数据,才能让 Open Graph 分享图、搜索引擎 canonical URL 和 sitemap 正常工作: After deploying to a custom domain, add these additional metadata fields to make Open Graph images, canonical URLs, and sitemaps work correctly:1
添加 metadataBase / Add metadataBase
在
metadata 对象中添加 metadataBase,指向你的正式域名。这是解析相对 URL(包括 Open Graph 图片路径)的基准:Add metadataBase to your metadata object pointing to your live domain. This resolves relative URLs including Open Graph image paths:2
添加 canonical URL / Add Canonical URL
为首页设置 canonical URL,防止多个 URL 指向同一内容时产生重复索引:Set a canonical URL for the homepage to prevent duplicate indexing when multiple URLs resolve to the same content:
3
添加验证过的 Open Graph 图片 / Add a Verified Open Graph Image
准备一张尺寸为 1200×630 px 的社交分享图,放入
public/ 目录后在 metadata 中引用:Prepare a 1200×630 px social sharing image, place it in public/, then reference it in metadata:4
为每个章节添加 sitemap 条目(可选)/ Add Sitemap Entries per Chapter (Optional)
如果你希望章节深链接被独立索引,可以在 如果你允许停用内置物件或增加 interactive 自定义资产,应从已发布 scene 计算有效 ID,而不是永久硬编码该数组。不要为 decorative 或 disabled 资产发布失效 URL。If your site disables built-ins or adds interactive custom assets, derive the effective IDs from the published scene instead of permanently hard-coding this array. Do not publish dead URLs for decorative or disabled assets.
app/sitemap.ts 中为当前启用的交互 ID 生成 ?section= 条目。默认 12 个内置 ID 只是起点:If you want chapter deep links indexed independently, generate ?section= entries for the currently enabled interactive IDs. The 12 default built-in IDs are only a starting point:双语 SEO 的现状与未来规划 / Bilingual SEO: Current State and Future Path
完整上线前 SEO 检查清单 / Pre-Launch SEO Checklist
在部署到正式域名并宣传你的主页前,完成以下核查: Before deploying to your custom domain and sharing your homepage, complete these checks:-
title包含你的真实姓名 /titleincludes your real name -
description是原创文字,不是复制的占位内容 /descriptionis original text, not copied placeholder content -
keywords反映你的真实专业方向 /keywordsreflect your actual areas of focus -
openGraph.title和openGraph.description已更新 /openGraph.titleandopenGraph.descriptionare updated -
twitter.title和twitter.description已更新 /twitter.titleandtwitter.descriptionare updated - 已添加
metadataBase并指向正式域名 /metadataBaseis set to your live domain - 已添加 canonical URL / Canonical URL is set
- 已准备并引用 1200×630 px Open Graph 图片 / A 1200×630 px Open Graph image is prepared and referenced
- 通过 OpenGraph.xyz 或类似工具验证分享卡片 / Validate the sharing card with OpenGraph.xyz or a similar tool
- 通过 Twitter Card Validator 验证 Twitter 卡片 / Validate the Twitter card with the Twitter Card Validator