astro-seo

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Astro SEO Skill

Astro SEO 技能

Purpose

用途

Handles all SEO markup for Astro projects. Technical SEO patterns.
处理Astro项目的所有SEO标记,实现技术SEO规范。

Core Rules

核心规则

  1. Every page needs unique title + description
  2. Open Graph for social sharing
  3. Schema.org for rich results
  4. Canonical URLs always set
  5. Sitemap auto-generated
  1. 每个页面需设置唯一标题+描述
  2. 配置用于社交分享的Open Graph
  3. 添加用于富文本结果的Schema.org
  4. 始终设置规范URL
  5. 自动生成站点地图

Required Meta Tags

必备Meta标签

astro
---
const { title, description, image, noindex = false } = Astro.props;
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
---

<head>
  <title>{title}</title>
  <meta name="description" content={description} />
  <link rel="canonical" href={canonicalURL} />
  {noindex && <meta name="robots" content="noindex,nofollow" />}

  <!-- Open Graph -->
  <meta property="og:title" content={title} />
  <meta property="og:description" content={description} />
  <meta property="og:url" content={canonicalURL} />
  <meta property="og:image" content={image} />
  <meta property="og:type" content="website" />

  <!-- Twitter -->
  <meta name="twitter:card" content="summary_large_image" />
</head>
astro
---
const { title, description, image, noindex = false } = Astro.props;
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
---

<head>
  <title>{title}</title>
  <meta name="description" content={description} />
  <link rel="canonical" href={canonicalURL} />
  {noindex && <meta name="robots" content="noindex,nofollow" />}

  <!-- Open Graph -->
  <meta property="og:title" content={title} />
  <meta property="og:description" content={description} />
  <meta property="og:url" content={canonicalURL} />
  <meta property="og:image" content={image} />
  <meta property="og:type" content="website" />

  <!-- Twitter -->
  <meta name="twitter:card" content="summary_large_image" />
</head>

Schema.org Patterns

Schema.org 配置方案

LocalBusiness (Homepage)

本地商家(首页)

json
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Business Name",
  "address": { "@type": "PostalAddress", ... },
  "telephone": "+44...",
  "openingHours": "Mo-Fr 08:00-18:00"
}
json
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Business Name",
  "address": { "@type": "PostalAddress", ... },
  "telephone": "+44...",
  "openingHours": "Mo-Fr 08:00-18:00"
}

Service Pages

服务页面

json
{
  "@context": "https://schema.org",
  "@type": "Service",
  "name": "Service Name",
  "provider": { "@type": "LocalBusiness", ... }
}
json
{
  "@context": "https://schema.org",
  "@type": "Service",
  "name": "Service Name",
  "provider": { "@type": "LocalBusiness", ... }
}

FAQ

常见问题(FAQ)

json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [...]
}
json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [...]
}

Sitemap

站点地图

javascript
// astro.config.mjs
import sitemap from '@astrojs/sitemap';

export default {
  site: 'https://yourdomain.com',
  integrations: [sitemap()]
}
javascript
// astro.config.mjs
import sitemap from '@astrojs/sitemap';

export default {
  site: 'https://yourdomain.com',
  integrations: [sitemap()]
}

Noindex Pages

需设置Noindex的页面

  • Thank you pages
  • 404/410 pages
  • Admin/preview pages
  • Duplicate content
  • 感谢页面
  • 404/410页面
  • 后台/预览页面
  • 重复内容页面

Related Skills

相关技能

  • local-seo
    — GBP, citations, area pages
  • heading-tree
    — H1-H4 structure
  • keyword-research
    — Keyword targeting
  • local-seo
    — 谷歌商家资料、引用、区域页面
  • heading-tree
    — H1-H4标题结构
  • keyword-research
    — 关键词定位

Definition of Done

完成标准

  • Unique title + description per page
  • Open Graph tags set
  • LocalBusiness schema on homepage
  • Service schema on service pages
  • FAQ schema where applicable
  • Sitemap configured
  • Canonical URLs set
  • Thank you pages noindexed
  • 每个页面设置唯一标题+描述
  • 配置Open Graph标签
  • 首页添加LocalBusiness schema
  • 服务页面添加Service schema
  • 适用场景添加FAQ schema
  • 配置站点地图
  • 设置规范URL
  • 感谢页面设置noindex