本文只说明 retrieval 子项目的 GEO 资产。项目使用 pnpm,Vite 构建目录为 price/;price/ 已被 Git 忽略,不要直接手工修改其中的文件。
构建后需要随站点上传:
public/llms.txt → /llms.txtpublic/robots.txt → /robots.txtpublic/sitemap.xml → /sitemap.xmlindex.html 中的 Organization、WebSite 和 SoftwareApplication JSON-LD只在仓库内维护,不要单独上传:
geo/jsonld/:结构化数据的可审阅源文件geo/snippets/:产品定义和 FAQ 的无样式 HTML 内容稿geo/internal/:事实边界、来源和禁写项geo/outlines/:内容团队的大纲geo/jsonld/article.json 和 geo/jsonld/breadcrumb.json 是候选模板,不应直接加入当前首页:
/contact 的“首页 → 获取方案”层级。只有页面增加可见面包屑并配置该路由的独立页面元数据后,才可部署。单独上传 JSON 文件不会让搜索引擎自动识别结构化数据;需要使用的 JSON-LD 必须出现在对应页面的 <script type="application/ld+json"> 中。
pnpm lint
pnpm build
构建完成后确认以下文件存在:
test -f price/llms.txt
test -f price/robots.txt
test -f price/sitemap.xml
上传完整的 price/ 目录,不要只上传 index.html 和 assets/。
现网曾将不存在的 /llms.txt、/robots.txt 和 /sitemap.xml 回退成首页 HTML。部署时要让真实静态文件优先于 SPA fallback,并为文本和 XML 返回正确的内容类型。
以下 Nginx 片段仅展示路由原则;root、缓存策略和安全头应合并到实际站点配置中:
location = /llms.txt {
try_files $uri =404;
default_type text/plain;
charset utf-8;
}
location = /robots.txt {
try_files $uri =404;
default_type text/plain;
}
location = /sitemap.xml {
try_files $uri =404;
default_type application/xml;
}
location /assets/ {
try_files $uri =404;
}
location = / {
try_files /index.html =404;
}
location ~ ^/(contact|privacy|agreement)/?$ {
try_files /index.html =404;
}
location / {
try_files $uri =404;
}
如果新增前端路由,需要同步更新允许回退到 index.html 的路由列表。未知路径应返回 404,避免形成 soft 404。
先检查状态码和内容类型:
curl -fsSI https://price.kailin.com.cn/llms.txt
curl -fsSI https://price.kailin.com.cn/robots.txt
curl -fsSI https://price.kailin.com.cn/sitemap.xml
预期:
/llms.txt 返回 200 和 text/plain; charset=utf-8/robots.txt 返回 200 和 text/plain/sitemap.xml 返回 200 和 XML 内容类型404再检查内容:
curl -fsS https://price.kailin.com.cn/llms.txt
curl -fsS https://price.kailin.com.cn/sitemap.xml
使用可执行 JavaScript 的浏览器检查首页:
最后使用 Schema Markup Validator 校验 Schema.org 语法,并使用 Google Rich Results Test 与 Search Console URL Inspection 检查线上抓取结果。结构化数据有助于机器理解页面,但不保证获得富结果或生成式搜索引用。
当前站点是客户端渲染的 React SPA,首次返回的 HTML 不包含完整页面正文。llms.txt 为不执行 JavaScript 的抓取器提供了核心事实,但若要进一步提高所有爬虫的可读性,后续仍应为首页和重要路由增加静态预渲染或服务端渲染,并为各路由提供独立的 title、description 和 canonical。