From d8a84684feccee00200a215de8d74e6a594376db Mon Sep 17 00:00:00 2001 From: sriramveeraghanta Date: Mon, 23 Feb 2026 18:07:04 +0530 Subject: [PATCH 1/2] fix: canonical links --- docs/.vitepress/config.mts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 25c4a72..f2ab74a 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -109,9 +109,6 @@ export default withMermaid(defineConfig({ ['meta', { name: 'keywords', content: 'plane, api, self-hosting, project management, developer documentation, kubernetes, docker, rest api, webhooks, plane api' }], ['meta', { name: 'theme-color', content: '#3b82f6' }], - // SEO: Canonical URL - ['link', { rel: 'canonical', href: 'https://developers.plane.so' }], - // Open Graph meta tags ['meta', { property: 'og:type', content: 'website' }], ['meta', { property: 'og:title', content: 'Developer documentation | Plane' }], @@ -126,6 +123,18 @@ export default withMermaid(defineConfig({ ['meta', { name: 'twitter:image', content: 'https://media.docs.plane.so/logo/og-docs.webp' }], ], + transformPageData(pageData) { + const canonicalUrl = `https://developers.plane.so/${pageData.relativePath}` + .replace(/index\.md$/, '') + .replace(/\.md$/, '') + + pageData.frontmatter.head ??= [] + pageData.frontmatter.head.push([ + 'link', + { rel: 'canonical', href: canonicalUrl } + ]) + }, + themeConfig: { siteTitle: false, logo: { From 6abf57e440ce18a03b00d00ae7ac54b23cef6083 Mon Sep 17 00:00:00 2001 From: sriramveeraghanta Date: Mon, 23 Feb 2026 18:12:22 +0530 Subject: [PATCH 2/2] fix: transform page data --- docs/.vitepress/config.mts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index f2ab74a..e4f30a3 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -124,15 +124,16 @@ export default withMermaid(defineConfig({ ], transformPageData(pageData) { - const canonicalUrl = `https://developers.plane.so/${pageData.relativePath}` - .replace(/index\.md$/, '') - .replace(/\.md$/, '') - - pageData.frontmatter.head ??= [] - pageData.frontmatter.head.push([ - 'link', - { rel: 'canonical', href: canonicalUrl } - ]) + const head = pageData.frontmatter.head ??= [] + const hasCanonical = head.some( + ([tag, attrs]) => tag === 'link' && attrs?.rel === 'canonical' + ) + if (!hasCanonical) { + const canonicalUrl = `https://developers.plane.so/${pageData.relativePath}` + .replace(/index\.md$/, '') + .replace(/\.md$/, '') + head.push(['link', { rel: 'canonical', href: canonicalUrl }]) + } }, themeConfig: {