diff --git a/src/components/Page/Page.js b/src/components/Page/Page.js index 0b033c25..3df6bab0 100644 --- a/src/components/Page/Page.js +++ b/src/components/Page/Page.js @@ -67,6 +67,7 @@ class PageComponent extends Component { location, intl, scrollingDisabled, + referrer, author, contentType, description, @@ -84,8 +85,11 @@ class PageComponent extends Component { [css.scrollingDisabled]: scrollingDisabled, }); + const referrerMeta = referrer ? : null; + const canonicalRootURL = config.canonicalRootURL; - const canonicalPath = canonicalRoutePath(routeConfiguration(), location); + const shouldReturnPathOnly = referrer && referrer !== 'unsafe-url'; + const canonicalPath = canonicalRoutePath(routeConfiguration(), location, shouldReturnPathOnly); const canonicalUrl = `${canonicalRootURL}${canonicalPath}`; const siteTitle = config.siteTitle; @@ -186,6 +190,7 @@ class PageComponent extends Component { }} > {title} + {referrerMeta} @@ -219,6 +224,7 @@ PageComponent.defaultProps = { facebookImages: null, twitterImages: null, published: null, + referrer: null, schema: null, tags: null, twitterHandle: null, @@ -231,6 +237,9 @@ PageComponent.propTypes = { children: any, scrollingDisabled: bool.isRequired, + // Handle referrer policy + referrer: string, + // SEO related props author: string, contentType: string, // og:type