Skip to content
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

Themes: Fix og:url meta, add canonical link tag #13505

Merged
merged 1 commit into from
Apr 28, 2017

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Apr 28, 2017

Previously, our <meta property="og:url" /> tags would set their content attr to either https://wordpress.com/themes/premium, https://wordpress.com/themes/free (depending on selected tier), or just https://wordpress.com/themes in all other cases.

This PR changes this so that meta always reflects the current pathname (i.e. route without query string). It also adds a <link rel="canonical" href="..." />.

To test: Logged-out, land on each of the following, and check Page Source. Verify that the meta and the link mentioned above are present and correctly point to the corresponding WordPress.com URL.

@ockham ockham added this to the Themes: Showcase M6-TheOne milestone Apr 28, 2017
@ockham ockham self-assigned this Apr 28, 2017
@matticbot
Copy link
Contributor

matticbot commented Apr 28, 2017

Test live: https://calypso.live/themes?branch=fix/themes-canonical-url

Note: live doesn't work.

@matticbot matticbot added the [Size] S Small sized issue label Apr 28, 2017
@ockham ockham added Server Side Rendering [Feature Group] Appearance & Themes Features related to the appearance of sites. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 28, 2017
@folletto
Copy link
Contributor

Tested on Chrome:

  • <meta property="og:url" content="https://wordpress.com/themes"><meta property="og:type" content="website"><link rel="canonical" href="https://wordpress.com/themes">
  • <meta property="og:url" content="https://wordpress.com/themes/free"><meta property="og:type" content="website"><link rel="canonical" href="https://wordpress.com/themes/free">
  • <meta property="og:url" content="https://wordpress.com/themes/photography"><meta property="og:type" content="website"><link rel="canonical" href="https://wordpress.com/themes/photography">
  • <meta property="og:url" content="https://wordpress.com/themes/photography/free"><meta property="og:type" content="website"><link rel="canonical" href="https://wordpress.com/themes/photography/free">
  • <meta property="og:url" content="https://wordpress.com/themes/photography/filter/author-bio"><meta property="og:type" content="website"><link rel="canonical" href="https://wordpress.com/themes/photography/filter/author-bio">

Also checked code. Seems even clearer to me now. 👍

🚢

@folletto folletto added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 28, 2017
@ockham
Copy link
Contributor Author

ockham commented Apr 28, 2017

Thanks for reviewing @folletto!

@ockham ockham merged commit 84269b8 into master Apr 28, 2017
@ockham ockham deleted the fix/themes-canonical-url branch April 28, 2017 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Appearance & Themes Features related to the appearance of sites. Server Side Rendering [Size] S Small sized issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants