Skip to content

Commit 92d81f9

Browse files
fix canonical
1 parent b98330e commit 92d81f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.vitepress/config/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default defineConfig({
1818
const head: HeadConfig[] = [ ...context.head ];
1919
if (!context.pageData.isNotFound) {
2020
const localesRegex = new RegExp(`^/(${Object.keys(locales).join('|')})`);
21-
const canonical = '/' + context.page.replace(/(index)?\.md$/, '');
21+
const canonical = '/' + context.page.replace(/\.md$/, '.html').replace(/\/index\.html$/, '/');
2222

2323
for (const locale of Object.keys(locales)) {
2424
const localePath = canonical.replace(localesRegex, `/${locale}`);

0 commit comments

Comments
 (0)