SEO技能 — 靜態網站優化
輕量級SEO稽核與修復工具,適用於靜態HTML網站(GitHub Pages、Netlify、Vercel等)。無需建置工具。會讀取您的HTML,回報缺少的項目,並加以補充。
設定
在首次使用前,請告訴Claude有關您網站的資訊,以便填入正確的值:
- 網域(例如
https://yourname.com) - 頁面(例如 index、about、resume、projects/foo)
- 社交個人檔案(LinkedIn、GitHub、Twitter等)
- 想要排名的關鍵字(例如「jane doe 軟體工程師」、「jane doe 作品集」)
Claude會為該工作階段儲存此上下文。您只需說一次即可。
被呼叫時的執行事項
讀取網站原始目錄中的所有HTML檔案。檢查以下每個項目。回報通過/未通過表格,然後提供修復缺少項目的選項。
1. 每個頁面的 <head> 必要元素
每個HTML頁面需要在 <head> 內包含以下內容:
<title>[頁面標題] — [您的名稱]</title>
<meta name="description" content="[獨特、150-160字元、包含目標關鍵字]">
<link rel="canonical" href="https://yourdomain.com/[路徑]/">
<!-- Open Graph -->
<meta property="og:title" content="[與標題相同或更短]">
<meta property="og:description" content="[與中繼描述相同]">
<meta property="og:image" content="https://yourdomain.com/[路徑-至-圖片]">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:url" content="https://yourdomain.com/[路徑]/">
<meta property="og:type" content="website">
<meta property="og:site_name" content="[您的名稱]">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="[與og:title相同]">
<meta name="twitter:description" content="[與og:description相同]">
<meta name="twitter:image" content="https://yourdomain.com/[路徑-至-圖片]">
指引:
- 標題:50-60字元。名稱加上區別要素。
- 中繼描述:150-160字元,每個頁面獨特,包含您的名稱和相關關鍵字。
- OG圖片:建議1200x630px。如果每個頁面沒有自訂圖片,請使用共用的圖片。使用網站上的真實圖片,不要用佔位符。
- 標準網址:必須完全符合實際部署的網址(結尾斜線一致性)。
2. 結構化資料(JSON-LD)
在主頁加入 Person + WebSite schema:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"name": "[您的名稱]",
"url": "https://yourdomain.com",
"jobTitle": "[您的職稱/角色]",
"affiliation": {
"@type": "Organization",
"name": "[學校或公司]"
},
"sameAs": [
"[GitHub URL]",
"[LinkedIn URL]"
],
"knowsAbout": ["[技能1]", "[技能2]", "[技能3]"]
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "[您的名稱] — [作品集標語]",
"url": "https://yourdomain.com"
}
</script>
對於專案頁面,請使用 CreativeWork:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "CreativeWork",
"name": "[專案名稱]",
"author": { "@type": "Person", "name": "[您的名稱]" },
"description": "[簡短的專案描述]",
"url": "https://yourdomain.com/[專案]/"
}
</script>
**規則:**僅使用JSON-LD(非Microdata/RDFa)。不要使用FAQPage(僅限政府/醫療保健使用)。不要使用HowTo(已棄用)。schema欄位中不要有佔位文字。
3. robots.txt
在網站根目錄建立:
User-agent: *
Allow: /
Sitemap: https://yourdomain.com/sitemap.xml
4. sitemap.xml
在網站根目錄建立:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://yourdomain.com/</loc>
<lastmod>[YYYY-MM-DD]</lastmod>
<priority>1.0</priority>
</url>
<!-- 為每個頁面重複 -->
</urlset>
將 lastmod 設為實際的最後編輯日期。當頁面變更時更新sitemap。
5. 圖片SEO
- 所有
<img>標籤都需要有描述性的alt文字(不要用「image1」或「screenshot」) - 盡可能使用WebP格式,保持圖片小於200KB
- 為折疊以下的圖片加入
loading="lazy" - OG圖片應是真實檔案,不是佔位符
6. 內容與關鍵字訊號
- **H1標籤:**每個頁面一個,包含名稱或專案名稱加上關鍵字
- 標題階層: h1 > h2 > h3,不要跳級
- **內文中的名稱:**您的名稱應自然出現在每個頁面上
- **內部連結:**頁面之間應互相連結(主頁連到專案、關於連到專案等)
- **外部連結:**從關於/主頁連結社交個人檔案
7. 技術檢查
- **HTTPS:**確認所有內部連結和資源使用
https:// - **結尾斜線一致性:**選擇一種模式並在所有的連結、標準網址和sitemap中保持一致
- **沒有失效連結:**檢查所有
href和src屬性是否能解析 - **行動裝置回應式:**所有頁面上都有視口viewport meta標籤
- **頁面速度:**延遲載入非關鍵腳本。JavaScript越少越好—靜態網站的良好基準。
8. 部署後驗證
部署後:
- 直接訪問
/robots.txt和/sitemap.xml以確認可存取 - 在Discord/Slack/Twitter上分享連結以測試OG標籤,並檢查預覽卡片
- 在Google Search Console中提交sitemap
- 幾天後搜尋
site:yourdomain.com以確認索引 - 搜尋您的目標查詢並隨著時間追蹤排名
9. Google Search Console設定
- 前往Google Search Console,為您的網域加入資源
- 透過DNS TXT紀錄或HTML檔案方式驗證
- 提交sitemap網址
- 監控Coverage報表以了解索引問題
快速稽核輸出
執行稽核時,讀取所有HTML檔案並輸出:
| 檢查項目 | 狀態 | 備註 |
|---|---|---|
| 中繼描述 | ... | ... |
| OG標籤 | ... | ... |
| JSON-LD schema | ... | ... |
| robots.txt | ... | ... |
| sitemap.xml | ... | ... |
| 圖片alt文字 | ... | ... |
| H1標籤 | ... | ... |
| 內部連結 | ... | ... |
| 標準網址 | ... | ... |
然後提供修復缺少項目的選項。