Skip to content

Commit 102ebb6

Browse files
committed
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 <thomas@tada.se>
1 parent fa87a58 commit 102ebb6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ module.exports = {
3939
},
4040

4141
canonicalURL: function(node) {
42-
return this.urlpath(node);
42+
const relpath = this.urlpath(node).split(path.posix.sep).slice(3).join(path.posix.sep);
43+
return `https://www.getambassador.io/docs/telepresence/latest/${relpath}`;
4344
},
4445

4546
githubURL: function(node) {

src/components/EasyLayout/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function EasyLayout({
2525
<Layout location={location}>
2626
<Helmet>
2727
<title>{title} | {data.site.siteMetadata.title}</title>
28-
<link rel="canonical" href={`${data.site.siteMetadata.siteURL}${location.pathname}`} />
28+
<link rel="canonical" href={`https://www.getambassador.io/docs/telepresence${location.pathname}`} />
2929
{ description && <meta name="description" content={description} /> }
3030
</Helmet>
3131
{children}

0 commit comments

Comments
 (0)