Skip to content

Commit 115e9d6

Browse files
authored
feat(seo): 完成高级 SEO 优化配置
## 概述 完成 GitHub Pages 站点的 SEO 优化配置,解决根目录 404 问题并实现多语言 SEO 最佳实践。 ## 主要变更 ### 文档结构重组 - 中文版作为根目录(解决根目录 404 问题) - 英文版移至 `/en/` 子目录 ### SEO 优化 - ✅ 添加 hreflang 标签(zh-CN, en-US, x-default) - ✅ 配置 sitemap.xml 生成(包含正确的 base path) - ✅ 添加 robots.txt 文件 - ✅ 为中英文首页添加 JSON-LD 结构化数据(SoftwareSourceCode schema) ### 文档优化 - 更新描述为更自然的表达方式 ## 测试计划 - [ ] 本地构建验证通过 - [ ] 本地预览验证 SEO 元素正确 - [ ] CI/CD 检查通过 - [ ] 部署后验证页面可访问 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 9f91170 commit 115e9d6

File tree

7 files changed

+89
-25
lines changed

7 files changed

+89
-25
lines changed

docs/.vitepress/config.mjs

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,59 @@
11
import { defineConfig } from 'vitepress'
22

33
export default defineConfig({
4-
title: 'Windows Folder Remark Tool',
5-
description: 'A lightweight CLI tool to add remarks/comments to Windows folders via Desktop.ini',
4+
title: 'Windows 文件夹备注工具',
5+
description: '一个轻量级的命令行工具,通过 Desktop.ini 为 Windows 文件夹添加备注/评论。无系统驻留,无数据上传,安全放心,用完即走。',
66
base: '/windows-folder-remark/',
7-
lang: 'en-US',
7+
lang: 'zh-CN',
88

99
locales: {
1010
root: {
11-
label: 'English',
12-
lang: 'en-US'
13-
},
14-
zh: {
1511
label: '简体中文',
16-
lang: 'zh-CN',
17-
link: '/zh/'
12+
lang: 'zh-CN'
13+
},
14+
en: {
15+
label: 'English',
16+
lang: 'en-US',
17+
link: '/en/'
18+
}
19+
},
20+
21+
head: [
22+
['link', { rel: 'alternate', hreflang: 'zh-CN', href: 'https://piratf.github.io/windows-folder-remark/' }],
23+
['link', { rel: 'alternate', hreflang: 'en-US', href: 'https://piratf.github.io/windows-folder-remark/en/' }],
24+
['link', { rel: 'alternate', hreflang: 'x-default', href: 'https://piratf.github.io/windows-folder-remark/en/' }]
25+
],
26+
27+
sitemap: {
28+
hostname: 'https://piratf.github.io',
29+
transformItems(items) {
30+
return items.map((item) => {
31+
return {
32+
url: '/windows-folder-remark' + (item.url.startsWith('/') ? '' : '/') + item.url,
33+
changefreq: 'weekly',
34+
}
35+
})
1836
}
1937
},
2038

2139
themeConfig: {
2240
nav: () => [
23-
{ text: 'Guide', link: '/en/guide/' },
24-
{ text: '中文', link: '/zh/' }
41+
{ text: '指南', link: '/guide/' },
42+
{ text: 'English', link: '/en/' }
2543
],
2644

2745
sidebar: {
46+
'/': [
47+
{
48+
text: '指南',
49+
items: [
50+
{ text: '介绍', link: '/' },
51+
{ text: '快速开始', link: '/guide/getting-started' },
52+
{ text: '使用方法', link: '/guide/usage' },
53+
{ text: 'API 参考', link: '/guide/api' }
54+
]
55+
}
56+
],
2857
'/en/': [
2958
{
3059
text: 'Guide',
@@ -35,17 +64,6 @@ export default defineConfig({
3564
{ text: 'API Reference', link: '/en/guide/api' }
3665
]
3766
}
38-
],
39-
'/zh/': [
40-
{
41-
text: '指南',
42-
items: [
43-
{ text: '介绍', link: '/zh/' },
44-
{ text: '快速开始', link: '/zh/guide/getting-started' },
45-
{ text: '使用方法', link: '/zh/guide/usage' },
46-
{ text: 'API 参考', link: '/zh/guide/api' }
47-
]
48-
}
4967
]
5068
}
5169
}

docs/en/index.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,35 @@
11
---
22
layout: home
33

4+
head:
5+
- - script
6+
- type: application/ld+json
7+
- |
8+
{
9+
"@context": "https://schema.org",
10+
"@type": "SoftwareSourceCode",
11+
"name": "Windows Folder Remark Tool",
12+
"description": "A lightweight CLI tool to add remarks/comments to Windows folders via Desktop.ini. No system residency, no data upload, safe and secure, use it when you need it.",
13+
"programmingLanguage": "Python",
14+
"codeRepository": "https://github.com/piratf/windows-folder-remark",
15+
"url": "https://piratf.github.io/windows-folder-remark/en/",
16+
"version": "2.0.6",
17+
"license": "MIT",
18+
"offers": {
19+
"@type": "Offer",
20+
"price": "0",
21+
"priceCurrency": "USD"
22+
}
23+
}
24+
425
hero:
526
name: Windows Folder Remark Tool
627
text: A Lightweight CLI Tool for Windows Folder Remarks
728
tagline: Add remarks/comments to Windows folders via Desktop.ini
829
actions:
930
- theme: brand
1031
text: Get Started
11-
link: /en/guide/getting-started
32+
link: /guide/getting-started
1233
- theme: alt
1334
text: GitHub
1435
link: https://github.com/piratf/windows-folder-remark
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/zh/index.md renamed to docs/index.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,35 @@
11
---
22
layout: home
33

4+
head:
5+
- - script
6+
- type: application/ld+json
7+
- |
8+
{
9+
"@context": "https://schema.org",
10+
"@type": "SoftwareSourceCode",
11+
"name": "Windows 文件夹备注工具",
12+
"description": "一个轻量级的命令行工具,通过 Desktop.ini 为 Windows 文件夹添加备注/评论。无系统驻留,无数据上传,安全放心,用完即走。",
13+
"programmingLanguage": "Python",
14+
"codeRepository": "https://github.com/piratf/windows-folder-remark",
15+
"url": "https://piratf.github.io/windows-folder-remark/",
16+
"version": "2.0.6",
17+
"license": "MIT",
18+
"offers": {
19+
"@type": "Offer",
20+
"price": "0",
21+
"priceCurrency": "USD"
22+
}
23+
}
24+
425
hero:
5-
name: Windows Folder Remark Tool
26+
name: Windows 文件夹备注工具
627
text: 轻量级 Windows 文件夹备注工具
728
tagline: 通过 Desktop.ini 为 Windows 文件夹添加备注/评论
829
actions:
930
- theme: brand
1031
text: 快速开始
11-
link: /zh/guide/getting-started
32+
link: /guide/getting-started
1233
- theme: alt
1334
text: GitHub
1435
link: https://github.com/piratf/windows-folder-remark

docs/robots.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
User-agent: *
2+
Allow: /
3+
4+
Sitemap: https://piratf.github.io/windows-folder-remark/sitemap.xml

0 commit comments

Comments
 (0)