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 { }} >