Skip to content

Commit

Permalink
fix: 站点地图 URL 后缀没有.html 导致 Google 没有收录网站
Browse files Browse the repository at this point in the history
  • Loading branch information
tomiaa12 committed Jun 20, 2023
1 parent 8c6b880 commit a6b6e18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/.vitepress/config.ts
Expand Up @@ -327,7 +327,7 @@ export default defineConfig({
transformHtml(code, id, { pageData }) {
if (!/[\\/]404\.html$/.test(id))
links.push({
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, "$2"),
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, "$2.html"),
lastmod: pageData.lastUpdated,
})
},
Expand Down

0 comments on commit a6b6e18

Please sign in to comment.