diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index b510acb..505769f 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -9,6 +9,16 @@ export default defineConfigWithTheme({ description: 'Examples of Vue patterns and basic components', appearance: false, + transformHead({ page, siteData: { base } }) { + if (page !== '404.md') { + const canonicalUrl = `https://skirtles-code.github.io${base}${page}` + .replace(/index\.md$/, '') + .replace(/\.md$/, '') + + return [['link', { rel: 'canonical', href: canonicalUrl }]] + } + }, + themeConfig: { search: { provider: 'local'