Skip to content

Commit

Permalink
Merge pull request #5402 from EnterpriseDB/bugfix/josh/DOCS-223-unver…
Browse files Browse the repository at this point in the history
…sioned-docs-pages-served-from-netlify-subdoma

DOCS-223: ensure every page has a rel="canonical" header
  • Loading branch information
josh-heyer authored Mar 21, 2024
2 parents 0c5d253 + ecd00d2 commit 4c5e347
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const Layout = ({
const { baseUrl, imageUrl, title: siteTitle } = useSiteMetadata();
const meta = pageMeta || {};
const url = meta.path ? baseUrl + meta.path : baseUrl;
const canonicalUrl = meta.canonicalPath ? baseUrl + meta.canonicalPath : url;
const title = meta.title ? `EDB Docs - ${meta.title}` : siteTitle;

const [dark, setDark] = useState(false);
Expand Down Expand Up @@ -122,9 +123,7 @@ const Layout = ({
)}
<meta property="og:image" content={imageUrl} />
<meta property="og:url" content={url} />
{meta.canonicalPath && (
<link rel="canonical" href={baseUrl + meta.canonicalPath} />
)}
<link rel="canonical" href={canonicalUrl} />
<meta name="twitter:card" content="summary_large_image" />
<body className={`bg-${background} fixed-container`} />
</Helmet>
Expand Down

1 comment on commit 4c5e347

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.