Skip to content

Commit

Permalink
Set canonical URL to corresponding proprietary docs at getambassador.io
Browse files Browse the repository at this point in the history
The proprietary documentation is very similar, so this is done to become
more SEO friendly.

Signed-off-by: Thomas Hallgren <[email protected]>
  • Loading branch information
thallgren committed Sep 10, 2024
1 parent 2935719 commit 02870a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/EasyLayout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function EasyLayout({
<Layout location={location}>
<Helmet>
<title>{title} | {data.site.siteMetadata.title}</title>
<link rel="canonical" href={`${data.site.siteMetadata.siteURL}${location.pathname}`} />
<link rel="canonical" href={`https://www.getambassador.io/docs/telepresence${location.pathname}`} />
{ description && <meta name="description" content={description} /> }
</Helmet>
{children}
Expand Down

0 comments on commit 02870a8

Please sign in to comment.