实战指南Guides › 静态站 SEO 实战:让 Cloudflare Pages 站点更好被收录

静态站 SEO 实战:让 Cloudflare Pages 站点更好被收录

更新:2026-10Updated: Oct 2026建站实战

静态站内容再好,搜索引擎抓不到也白搭。这篇把内容站过审与收录所需的 SEO 基建一次讲清,全部是本站正在用的方案。Great content is worthless if search can't crawl it. Here's the full SEO stack this site actually uses.

结构化数据(JSON-LD)Structured data

每页基础 metaPer-page meta

站点地图与抓取规则Sitemap & robots

生成 sitemap.xml 列出全部页面,并在 robots.txt 里指向它。用 Search Console 提交后,可主动请求收录。站点地图要随内容更新同步补充。List every page in sitemap.xml, point robots.txt at it, submit via Search Console and request indexing. Keep it updated as content grows.

多语言站点的额外要求Extra for multilingual

本站用「单 URL + JS 切换语言」方案:同一页面内含中英两种文案,由前端切换。对 SEO 更友好的做法是独立 URL(/zh/、/en/),但维护成本高。选哪种取决于规模。We use single-URL with JS language switching. Separate /zh/ and /en/ URLs are cleaner for SEO but cost more to maintain. Pick by scale.

上 AdSense 前的 SEO checklistPre-AdSense checklist

结构化数据该怎么选Choosing structured data

批量注入的实现Bulk injection approach

页面一多,逐个手写 head 标签不现实。实用做法是写一个幂等脚本:遍历所有 HTML,自动注入 OG / Twitter / hreflang / JSON-LD,并用注释标记防止重复注入。改内容后重跑一次即可全站同步。With many pages, hand-editing heads is impractical. Write an idempotent script that walks all HTML, injects OG/Twitter/hreflang/JSON-LD, and uses a marker comment to avoid duplicates. Re-run after edits.

社交分享图Social share image

配一张 1200×630 的 Open Graph 图,分享到社交平台时才有像样的卡片。可以用 Python(Pillow)程序化生成带品牌色的图,比手动做省事,也便于统一风格。Add a 1200×630 OG image so shared links render proper cards. Generating it programmatically with Pillow keeps the style consistent.

多语言的两种方案Two i18n approaches

无论哪种,都要用 hreflang 声明各语言版本,并确保两种语言都有足够内容量,避免 Thin Content。Either way, declare hreflang for all variants and ensure each language has enough content to avoid thin pages.

seo-layers.svg
示意图 · seo-layers.svgDiagram · seo-layers.svg

真实案例:SEO 基建如何一次性铺好Real case: the SEO stack built once

本站在 24 篇文章的规模下一次性把 SEO 基建做好:全站注入 OG / JSON-LD / hreflang,14 篇评测带 Review 评分(可出星级富摘要),目录页使用 ItemList,sitemap 含 30 个 URL 并提交 Search Console。整个基建靠一个幂等脚本完成,新增内容后重跑一次即可全站同步。At 24 articles the SEO stack was built once: OG / JSON-LD / hreflang sitewide, 14 reviews with Review ratings (eligible for star rich results), ItemList on listing pages, and a 30-URL sitemap submitted to Search Console. The whole stack runs off one idempotent script — re-run after adding content to sync everything.

Advertisement
广告位(AdSense 接入后显示)Ad slot

相关工具Related Tools