From 102ebb6f2ad3a9128406ba1971c5813f5fd6ccce Mon Sep 17 00:00:00 2001 From: Thomas Hallgren Date: Tue, 10 Sep 2024 08:38:07 +0200 Subject: [PATCH] Set canonical URL to corresponding proprietary docs at getambassador.io The proprietary documentation is very similar, so this is done to become more SEO friendly. Signed-off-by: Thomas Hallgren --- docs-config.js | 3 ++- src/components/EasyLayout/index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs-config.js b/docs-config.js index c3187341..f13bd7fa 100644 --- a/docs-config.js +++ b/docs-config.js @@ -39,7 +39,8 @@ module.exports = { }, canonicalURL: function(node) { - return this.urlpath(node); + const relpath = this.urlpath(node).split(path.posix.sep).slice(3).join(path.posix.sep); + return `https://www.getambassador.io/docs/telepresence/latest/${relpath}`; }, githubURL: function(node) { diff --git a/src/components/EasyLayout/index.js b/src/components/EasyLayout/index.js index 1d9c2920..6c9d640a 100644 --- a/src/components/EasyLayout/index.js +++ b/src/components/EasyLayout/index.js @@ -25,7 +25,7 @@ export default function EasyLayout({ {title} | {data.site.siteMetadata.title} - + { description && } {children}