|
| 1 | +# SEO 优化完成清单 |
| 2 | + |
| 3 | +## ✅ 已完成的配置 |
| 4 | + |
| 5 | +### 1. 核心插件配置 |
| 6 | +- ✅ **jekyll-seo-tag**: 自动生成 SEO 元信息、Open Graph、Twitter Card、JSON-LD 结构化数据 |
| 7 | +- ✅ **jekyll-sitemap**: 自动生成 `/sitemap.xml` |
| 8 | +- ✅ 已添加到 `_config.yml` 和 `Gemfile` |
| 9 | + |
| 10 | +### 2. 站点元信息 (_config.yml) |
| 11 | +```yaml |
| 12 | +title: "Kaermaxc Blog - 日复一日" |
| 13 | +description: "记录开发实践与思考:Neovim、C/C++、Jekyll、电机控制与自动化。" |
| 14 | +url: https://magic-alt.github.io |
| 15 | +logo: /assets/images/logo.svg |
| 16 | +author: |
| 17 | + name: Kaermaxc |
| 18 | + url: https://magic-alt.github.io |
| 19 | +``` |
| 20 | +
|
| 21 | +### 3. SEO 标签注入 (_includes/head.html) |
| 22 | +- ✅ 添加了 `{% seo %}` 标签 |
| 23 | +- ✅ 添加了 `<link rel="canonical">` 标签 |
| 24 | +- ✅ 保留了 `viewport` meta 标签 |
| 25 | + |
| 26 | +### 4. robots.txt |
| 27 | +- ✅ 创建了 `/robots.txt` |
| 28 | +- ✅ 指明了 sitemap 位置: `https://magic-alt.github.io/sitemap.xml` |
| 29 | +- ✅ 允许所有爬虫访问 |
| 30 | + |
| 31 | +### 5. 站点 Logo |
| 32 | +- ✅ 创建了 `/assets/images/logo.svg` |
| 33 | +- ✅ 包含 K 字母设计,紫色渐变背景 |
| 34 | +- ✅ 适用于社交分享和 SEO |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## 📋 下一步操作(需要手动完成) |
| 39 | + |
| 40 | +### 1. 站长平台验证 |
| 41 | + |
| 42 | +#### Google Search Console |
| 43 | +1. 访问: https://search.google.com/search-console |
| 44 | +2. 添加资源: `https://magic-alt.github.io` |
| 45 | +3. 选择验证方式: |
| 46 | + - **推荐**: HTML 标签验证 |
| 47 | + - 复制验证代码(如: `<meta name="google-site-verification" content="abc123...">`) |
| 48 | + - 将代码中的 `abc123...` 填入 `_config.yml`: |
| 49 | + ```yaml |
| 50 | + webmaster_verifications: |
| 51 | + google: "abc123..." # 替换为你的验证码 |
| 52 | + ``` |
| 53 | +4. 提交并验证 |
| 54 | +5. 提交 Sitemap: |
| 55 | + - 进入"Sitemaps"页面 |
| 56 | + - 添加新的站点地图: `sitemap.xml` |
| 57 | + - 提交 |
| 58 | + |
| 59 | +#### Bing Webmaster Tools |
| 60 | +1. 访问: https://www.bing.com/webmasters |
| 61 | +2. 添加站点: `https://magic-alt.github.io` |
| 62 | +3. 验证方式同上,将验证码填入: |
| 63 | + ```yaml |
| 64 | + webmaster_verifications: |
| 65 | + bing: "xyz789..." # 替换为你的验证码 |
| 66 | + ``` |
| 67 | +4. 提交 Sitemap: `https://magic-alt.github.io/sitemap.xml` |
| 68 | + |
| 69 | +### 2. 验证 SEO 效果 |
| 70 | + |
| 71 | +部署完成后(通常 3-5 分钟),访问以下 URL 验证: |
| 72 | + |
| 73 | +- **Sitemap**: https://magic-alt.github.io/sitemap.xml |
| 74 | +- **Robots**: https://magic-alt.github.io/robots.txt |
| 75 | +- **RSS Feed**: https://magic-alt.github.io/feed.xml |
| 76 | + |
| 77 | +查看页面源代码,确认 `<head>` 中包含: |
| 78 | +```html |
| 79 | +<!-- 由 jekyll-seo-tag 自动生成 --> |
| 80 | +<title>...</title> |
| 81 | +<meta name="description" content="..."> |
| 82 | +<meta property="og:title" content="..."> |
| 83 | +<meta property="og:description" content="..."> |
| 84 | +<meta property="og:image" content="..."> |
| 85 | +<meta name="twitter:card" content="summary_large_image"> |
| 86 | +<script type="application/ld+json"> |
| 87 | +{ |
| 88 | + "@context": "https://schema.org", |
| 89 | + "@type": "BlogPosting", |
| 90 | + ... |
| 91 | +} |
| 92 | +</script> |
| 93 | +<link rel="canonical" href="..."> |
| 94 | +``` |
| 95 | + |
| 96 | +### 3. 主动提交新文章 |
| 97 | + |
| 98 | +每次发布新文章后,可以通过以下方式加速收录: |
| 99 | + |
| 100 | +#### Google Search Console |
| 101 | +1. 打开"网址检查 / URL Inspection"工具 |
| 102 | +2. 输入新文章 URL |
| 103 | +3. 点击"请求编入索引" |
| 104 | + |
| 105 | +#### Bing Webmaster Tools |
| 106 | +1. 使用"URL Submission"工具 |
| 107 | +2. 提交新文章 URL |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## 🎯 博文 SEO 最佳实践 |
| 112 | + |
| 113 | +每篇新博文的 Front Matter 应包含: |
| 114 | + |
| 115 | +```yaml |
| 116 | +--- |
| 117 | +layout: post |
| 118 | +title: "简洁有力的标题(≤60字符,含关键词)" |
| 119 | +description: "120-160字符的描述,包含目标关键词,自然可读" |
| 120 | +tags: [关键词1, 关键词2, 关键词3] |
| 121 | +date: 2025-10-17 |
| 122 | +--- |
| 123 | +``` |
| 124 | + |
| 125 | +**示例**: |
| 126 | +```yaml |
| 127 | +--- |
| 128 | +layout: post |
| 129 | +title: "Jekyll + GitHub Pages SEO 优化完整指南" |
| 130 | +description: "10分钟完成 Jekyll 博客的 SEO 配置:sitemap、robots、canonical、结构化数据与站长验证实操。" |
| 131 | +tags: [Jekyll, GitHub Pages, SEO, 教程] |
| 132 | +date: 2025-10-17 |
| 133 | +--- |
| 134 | +``` |
| 135 | + |
| 136 | +--- |
| 137 | + |
| 138 | +## 🔍 SEO 检测工具 |
| 139 | + |
| 140 | +使用以下工具验证 SEO 效果: |
| 141 | + |
| 142 | +1. **Google Rich Results Test**: https://search.google.com/test/rich-results |
| 143 | + - 检查结构化数据是否正确 |
| 144 | + |
| 145 | +2. **Google Mobile-Friendly Test**: https://search.google.com/test/mobile-friendly |
| 146 | + - 确认移动端友好性 |
| 147 | + |
| 148 | +3. **PageSpeed Insights**: https://pagespeed.web.dev/ |
| 149 | + - 检查性能和 Core Web Vitals |
| 150 | + |
| 151 | +4. **Bing Webmaster SEO Analyzer**: |
| 152 | + - 使用 Bing 提供的 SEO 分析工具 |
| 153 | + |
| 154 | +--- |
| 155 | + |
| 156 | +## 📊 预期效果 |
| 157 | + |
| 158 | +完成以上配置后,你的博客将获得: |
| 159 | + |
| 160 | +✅ **自动化 SEO**: 每篇文章自动生成完整的元信息 |
| 161 | +✅ **搜索引擎友好**: sitemap 和 robots.txt 帮助爬虫高效抓取 |
| 162 | +✅ **社交分享优化**: Open Graph 和 Twitter Card 让分享更美观 |
| 163 | +✅ **结构化数据**: JSON-LD 格式的 BlogPosting Schema |
| 164 | +✅ **Canonical URL**: 避免重复内容问题 |
| 165 | +✅ **站长工具集成**: 方便监控索引状态和搜索表现 |
| 166 | + |
| 167 | +--- |
| 168 | + |
| 169 | +## 🚀 性能优化建议(可选) |
| 170 | + |
| 171 | +1. **图片优化** |
| 172 | + - 使用 WebP/AVIF 格式 |
| 173 | + - 添加 `loading="lazy"` 属性 |
| 174 | + - 压缩图片大小 |
| 175 | + |
| 176 | +2. **内部链接** |
| 177 | + - 在文章中添加相关文章推荐 |
| 178 | + - 创建专题汇总页面(支柱内容) |
| 179 | + |
| 180 | +3. **外部链接** |
| 181 | + - 添加 `rel="noopener noreferrer"` 到外链 |
| 182 | + |
| 183 | +4. **内容结构** |
| 184 | + - 使用清晰的标题层级 (H1 > H2 > H3) |
| 185 | + - 添加目录(TOC) |
| 186 | + - 保持段落简洁 |
| 187 | + |
| 188 | +--- |
| 189 | + |
| 190 | +## 📝 配置文件位置 |
| 191 | + |
| 192 | +- `_config.yml` - 站点全局配置 |
| 193 | +- `_includes/head.html` - SEO 标签注入位置 |
| 194 | +- `robots.txt` - 爬虫指令 |
| 195 | +- `Gemfile` - 插件依赖 |
| 196 | +- `assets/images/logo.svg` - 站点 Logo |
| 197 | + |
| 198 | +--- |
| 199 | + |
| 200 | +## 🆘 故障排除 |
| 201 | + |
| 202 | +### Sitemap 未生成? |
| 203 | +- 确认 `jekyll-sitemap` 在 `_config.yml` 的 `plugins` 列表中 |
| 204 | +- 重新构建: `bundle exec jekyll build` |
| 205 | +- 检查 `_site/sitemap.xml` 是否存在 |
| 206 | + |
| 207 | +### SEO 标签未显示? |
| 208 | +- 确认 `jekyll-seo-tag` 已安装 |
| 209 | +- 检查 `_includes/head.html` 中是否有 `{% seo %}` |
| 210 | +- 查看浏览器源代码确认 |
| 211 | + |
| 212 | +### 站长验证失败? |
| 213 | +- 确认验证码已正确填入 `_config.yml` |
| 214 | +- 推送后等待 3-5 分钟 GitHub Pages 构建完成 |
| 215 | +- 刷新页面并重新验证 |
| 216 | + |
| 217 | +--- |
| 218 | + |
| 219 | +**最后更新**: 2025-10-17 |
| 220 | +**状态**: ✅ 所有核心 SEO 配置已完成并推送到 GitHub |
0 commit comments