SEO: make the MGH site canonical, not the GitHub Pages mirror - #1
Merged
Merged
Conversation
Both deployments serve byte-identical HTML, and site.url feeds the canonical tag, og:url and jekyll-sitemap. With url set to ivazquez.github.io, the MGH site emitted <link rel="canonical" href="https://ivazquez.github.io/"> and a sitemap listing only github.io URLs, telling search engines the GitHub mirror is the authoritative copy of the lab website.
|
Failed prettier code check. Check this file for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
vazquezgarcialab.mgh.harvard.eduandivazquez.github.ioserve byte-identical HTML (23,070 bytes each). When search engines see duplicates they obey the canonical tag — and every signal on the MGH site currently names the GitHub mirror as authoritative:So the MGH site has been instructing search engines to rank the GitHub Pages mirror ahead of it. That is the configured behaviour, not a quirk of indexing.
Change
One line in
_config.yml:site.urlfeeds the canonical tag,og:urlandjekyll-sitemap. After this, both deployments name the MGH domain as authoritative; the GitHub Pages mirror defers to it, consolidating accumulated ranking signals onto the institutional domain.Why this is safe for the GitHub Pages mirror
absolute_urlis used exactly once in_includes/head.liquid— line 70, the canonical tag.head.liquiduserelative_url, so the mirror keeps rendering correctly. It simply stops claiming primacy.CNAMEin the repo, so Pages continues serving ativazquez.github.ioas before.Follow-ups (not in this PR)
https://vazquezgarcialab.mgh.harvard.edu/sitemap.xml. Thegoogle_site_verification:key in_config.ymlis currently empty and is how the meta-tag verification is wired.noindexto the mirror —noindexpluscanonicalare contradictory signals and are handled poorly. Canonical alone is the correct mechanism here.Note on deployment
The MGH site is served by Plesk on
erisweb5.partners.org, which pulls from this repo. Its push webhook has been returning502 failed to connect to hostsince ~July 12 (port 8443 is firewalled externally), so the site went ~10 weeks stale. A manual pull has since restored it, but this change only reaches the MGH site on the next pull.