You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rewrite hexdocs.pm canonical links to per-package subdomains (#119)
ExDoc emits a <link rel="canonical"> tag (when the package sets the
:canonical option) pointing at the old path-based URL,
https://hexdocs.pm/<package>/... . Now that docs are served from
per-package subdomains, that canonical points away from where the page
actually lives, splitting SEO signal.
Rewrite the canonical tag at ingestion time in the file rewriter so it
points at https://<package>.hexdocs.pm/... , reusing package_to_subdomain
for the underscore-to-hyphen mapping and upgrading http to https. The
bare apex, apex files such as sitemap.xml, and canonical links that
already use a subdomain are left untouched.
Body links and other tags are intentionally not rewritten: a permanent
redirect from the old URLs preserves link equity via 301, so canonical
is the only tag where the rewrite changes SEO behavior.
0 commit comments