Skip to content

Commit

Permalink
add canonnnical link to 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev committed Jun 7, 2024
1 parent 25d3487 commit 6314588
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ const config = {
['meta', { name:"msapplication-config", content:"/favicons/browserconfig.xml" }],
['meta', { name:"theme-color", content:"#ffffff" }],
],
transformPageData(pageData) {
const canonicalUrl = `https://docs.avohq.io/${pageData.relativePath}`
.replace(/index\.md$/, '')
.replace(/\.md$/, '.html')
.replace(/2\.0/, '3.0')

pageData.frontmatter.head ??= []
pageData.frontmatter.head.push([
'link',
{ rel: 'canonical', href: canonicalUrl }
])
},
themeConfig: {
siteTitle: false,
logo: "/logo.svg",
Expand Down

0 comments on commit 6314588

Please sign in to comment.