Skip to content

ADD canonical url#447

Closed
AritzPalaciosOrtiz wants to merge 2 commits into5.5from
canonical-url
Closed

ADD canonical url#447
AritzPalaciosOrtiz wants to merge 2 commits into5.5from
canonical-url

Conversation

@AritzPalaciosOrtiz
Copy link
Member

No description provided.

{% if canonicalUrl %}
<link rel="canonical" href="{{ canonicalUrl }}" />
{% endif %}
{% for locale, url in sfs_cms_alternate_urls() %}
Copy link
Member

Choose a reason for hiding this comment

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

The alternate links should only be rendered when the current page is the canonical URL. If canonicalUrl is different from the current URL, it means the page is not the canonical version. In that case, we should only output the canonical tag pointing to the canonical page, but not the hreflang alternates, since those should only exist on the canonical version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants