rendering-strategies by kostja94/marketing-skills
npx skills add https://github.com/kostja94/marketing-skills --skill rendering-strategies指导搜索引擎和 AI 爬虫可见性的渲染策略选择与优化。黄金法则:页面数据和元数据必须在页面加载时即可用,无需执行 JavaScript,以实现最佳 SEO。
调用时机:在首次使用时,如果合适,用 1-2 句话开场说明此技能涵盖的内容及其重要性,然后提供主要输出。在后续使用或用户要求跳过时,直接进入主要输出。
| 方法 | HTML 生成时机 | SEO 友好性 | 最佳适用场景 |
|---|---|---|---|
| SSG(静态站点生成) | 构建时 | ✅ 最佳 | 博客、文档、营销页面;内容很少变化 |
| SSR(服务器端渲染) | 请求时 | ✅ 良好 | 新闻、产品页面;动态、个性化内容 |
| (增量静态再生) |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 构建 + 重新验证 |
| ✅ 良好 |
| 大型站点;静态但需定期更新 |
| CSR(客户端渲染) | 浏览器(JS 加载后) | ❌ 较差 | 仪表板、账户页面;无需 SEO |
| 动态渲染 | 按需为机器人生成 | ✅ 后备方案 | SPA;为爬虫预渲染,为用户提供 SPA |
HTML 在构建时生成;每次请求返回相同的 HTML。SEO 最佳:爬虫立即收到完整的 HTML;性能最优。
getStaticProps、Astro、GatsbyHTML 在每次请求时生成。SEO 良好:爬虫收到完整的 HTML;支持动态、个性化内容。
getServerSideProps、Remix构建时静态生成;页面可在一段时间后重新验证。SEO 良好:结合了静态性能与内容新鲜度。
getStaticProps 中的 revalidate服务器发送最小的 HTML 外壳;内容在浏览器加载 JS 后渲染。不适合 SEO:爬虫可能看到空内容;导致索引延迟或失败。
向爬虫提供预渲染的 HTML;向用户提供 SPA。当无法实现完整的 SSR/SSG 时的后备方案(例如,遗留 SPA 迁移期间)。
| 爬虫 | JavaScript 处理 | 初始 HTML 中的内容 |
|---|---|---|
| Googlebot | 渲染 JS(Chrome);可能有数天的队列延迟 | 完全权重;首选 SSR/SSG |
| AI 爬虫(GPTBot、ClaudeBot、PerplexityBot) | 不执行 JS | 必需——CSR 内容不可见 |
| Bingbot | 渲染 JS | 与 Googlebot 相同 |
AI 爬虫:约占 Googlebot 爬取量的 28%。关键内容(文章、元数据、导航)必须在初始 HTML 中。关于 AI 爬虫优化,请参阅 site-crawlability;关于 GEO,请参阅 generative-engine-optimization。
Google 不会模拟用户点击(标签页、轮播图、“加载更多”)。通过 AJAX 或交互加载的内容无法被发现。
| 组件 | 要求 | 实现方式 |
|---|---|---|
| 标签页 / 手风琴 | 所有标签页内容在加载时位于 DOM 中 | 服务器端渲染;使用 <details>/<summary> 或 CSS 显示/隐藏 |
| 轮播图 | 所有幻灯片在初始 HTML 中 | 服务器端渲染;仅使用 CSS/JS 进行显示/隐藏 |
| Hero 区域 | 标题、CTA、LCP 图片在 HTML 中 | 避免仅用 JS 渲染 |
| 导航 | 所有导航链接在首次绘制时出现 | 关键链接避免使用 JS 注入的菜单 |
建议:对所有关键内容进行服务器端渲染(SSR/SSG);仅将 JS 用于交互(显示/隐藏、动画)。点击加载的内容 = 不被索引。
| 内容类型 | 渲染方式 | 原因 |
|---|---|---|
| 博客、文档、营销 | SSG 或 ISR | SEO 最佳;速度快;静态 |
| 产品、新闻、动态内容 | SSR | 内容新鲜;爬虫就绪 |
| 仪表板、账户 | CSR | 无需 SEO;需要认证 |
| 遗留 SPA | 动态渲染 | 迁移到 SSR/SSG 前的过渡方案 |
每周安装量
102
代码仓库
GitHub 星标数
237
首次出现
13 天前
安全审计
已安装于
cursor96
gemini-cli95
kimi-cli95
codex95
opencode95
github-copilot95
Guides rendering strategy selection and optimization for search engine and AI crawler visibility. Golden rule : Page data and metadata must be available on page load without JavaScript execution for optimal SEO.
When invoking : On first use , if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.
| Method | When HTML generated | SEO | Best for |
|---|---|---|---|
| SSG (Static Site Generation) | Build time | ✅ Best | Blog, docs, marketing pages; content rarely changes |
| SSR (Server-Side Rendering) | Request time | ✅ Good | News, product pages; dynamic, personalized content |
| ISR (Incremental Static Regeneration) | Build + revalidate | ✅ Good | Large sites; static with periodic updates |
| CSR (Client-Side Rendering) | Browser (after JS) | ❌ Poor | Dashboards, account pages; no SEO needed |
| Dynamic rendering | On-demand for bots | ✅ Fallback | SPAs; prerender for crawlers, SPA for users |
HTML generated at build time; same HTML for every request. Best for SEO : crawlers receive full HTML immediately; optimal performance.
getStaticProps, Astro, GatsbyHTML generated on each request. Good for SEO : crawlers receive complete HTML; supports dynamic, personalized content.
getServerSideProps, RemixStatic at build; pages can revalidate after a period. Good for SEO : combines static performance with freshness.
revalidate in getStaticPropsServer sends minimal HTML shell; content renders in browser after JS loads. Not for SEO : crawlers may see empty content; indexing delays or failures.
Serve prerendered HTML to crawlers; serve SPA to users. Fallback when full SSR/SSG is not feasible (e.g. legacy SPA migration).
| Crawler | JavaScript | Content in initial HTML |
|---|---|---|
| Googlebot | Renders JS (Chrome); may have multi-day queue | Full weight; SSR/SSG preferred |
| AI crawlers (GPTBot, ClaudeBot, PerplexityBot) | Do not execute JS | Required —CSR content invisible |
| Bingbot | Renders JS | Same as Googlebot |
AI crawlers : ~28% of Googlebot's crawl volume. Critical content (articles, meta, nav) must be in initial HTML. See site-crawlability for AI crawler optimization; generative-engine-optimization for GEO.
Google does not simulate user clicks (tabs, carousels, "Load more"). Content loaded via AJAX or on interaction is not discoverable.
| Component | Requirement | Implementation |
|---|---|---|
| Tabs / Accordion | All tab content in DOM at load | Server-render; use <details>/<summary> or CSS show/hide |
| Carousel | All slides in initial HTML | Server-render; CSS/JS for show/hide only |
| Hero | Headline, CTA, LCP image in HTML | No JS-only rendering |
| Navigation | All nav links in first paint | No JS-injected menus for critical links |
Recommendation : Server-render (SSR/SSG) all critical content; use JS only for interaction (show/hide, animation). Content loaded on click = not indexed.
| Content type | Rendering | Reason |
|---|---|---|
| Blog, docs, marketing | SSG or ISR | Best SEO; fast; static |
| Product, news, dynamic | SSR | Fresh content; crawler-ready |
| Dashboard, account | CSR | No SEO; auth required |
| Legacy SPA | Dynamic rendering | Bridge until SSR/SSG migration |
Weekly Installs
102
Repository
GitHub Stars
237
First Seen
13 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
cursor96
gemini-cli95
kimi-cli95
codex95
opencode95
github-copilot95
Schema标记专家指南:结构化数据实现与SEO优化,提升富媒体搜索结果
31,400 周安装
AI语音克隆与角色扮演工具 - 从视频或照片生成真实人物声音进行对话
1,600 周安装
LobeHub React 组件库与路由架构指南 | 高效开发组件与混合路由方案
1,600 周安装
Google搜索浏览器使用指南 - 通过browser-use实现真实浏览器模式搜索与内容提取
1,600 周安装
ElevenLabs API密钥设置指南:快速配置语音合成API密钥与环境变量
1,600 周安装
使用 x402 协议构建付费 API 服务器 | 通过 USDC 按请求收费
1,600 周安装
Coinbase Agentic Wallet send-usdc 技能:Base链USDC转账命令教程
1,600 周安装