Skip to content

Canonical meta tag #898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 11, 2018
Merged

Canonical meta tag #898

merged 3 commits into from
May 11, 2018

Conversation

thomasleese
Copy link
Contributor

@thomasleese thomasleese commented May 11, 2018

This adds a canonical URL link tag to all pages. For content items with parts, it makes sure that the part slug is included at the end of the URL.

Trello Card


Visual regression results:
https://government-frontend-pr-898.surge.sh/gallery.html

Component guide for this PR:
https://government-frontend-pr-898.herokuapp.com/component-guide

This generates a canonical URL for content items based on its
web_url combined with a part slug if necessary.
This ensures that a content item with parts will have the correct
URL.
@thomasleese thomasleese merged commit 03eb0f8 into master May 11, 2018
@thomasleese thomasleese deleted the canonical-meta-tag branch May 11, 2018 09:01
<meta property="og:site_name" content="GOV.UK" />
<meta property="og:type" content="article" />
<meta property="og:url" content="<%= @content_item.web_url %>" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice fix! 👍

tijmenb added a commit to alphagov/govuk_publishing_components that referenced this pull request May 22, 2018
tijmenb added a commit to alphagov/govuk_publishing_components that referenced this pull request May 23, 2018
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.

3 participants