Skip to content

Use subdomain URLs for hexpm package docs#1172

Merged
ericmj merged 2 commits into
mainfrom
hexdocs-subdomain-urls
May 29, 2026
Merged

Use subdomain URLs for hexpm package docs#1172
ericmj merged 2 commits into
mainfrom
hexdocs-subdomain-urls

Conversation

@ericmj
Copy link
Copy Markdown
Member

@ericmj ericmj commented May 29, 2026

Switch hexpm-repo docs URLs the CLI emits from https://hexdocs.pm/PACKAGE/... to https://PACKAGE.hexdocs.pm/.... Org-repo URLs (*.hexorgs.pm) are unchanged.

Phase 3 of the hexdocs subdomain migration. The apex https://hexdocs.pm/PACKAGE/... URLs continue to work via a 301 to the subdomain (Hex.HTTP follows up to 3 redirects), so pre-existing CLIs are unaffected.

Changes:

  • lib/hex/utils.ex — four hexdocs_url/hexdocs_module_url hexpm-repo clauses switched to subdomain form.
  • lib/mix/tasks/hex.search.exdocument_url/2 per-result URL switched to subdomain form. The apex search-landing-page URL (https://hexdocs.pm/?packages=...&q=) is unchanged; the search page lives at the apex.
  • lib/mix/tasks/hex.publish.ex — docstring updated to describe new URL scheme.
  • lib/hex/scm.ex — doc-link comment updated for consistency.
  • Tests updated to assert the new URL format.

ericmj added 2 commits May 29, 2026 11:07
Switch hexpm-repo docs URLs from `https://hexdocs.pm/PACKAGE/...`
to `https://PACKAGE.hexdocs.pm/...`. Org-repo URLs are unchanged.
Hex package names allow underscores. RFC 1123 hostname labels and
RFC 6125 wildcard SAN matching don't, and Fastly enforces strict SAN
matching at the HTTP edge — phoenix_live_view.hexdocs.pm returns 421
'Misdirected Request' even though the wildcard cert covers
*.hexdocs.pm. The Fastly Compute subdomain handler reverses the
mapping before the GCS bucket key lookup so canonical hex names
continue to be the storage key.

Apply the same mapping in the Hex CLI helpers that emit hexpm-repo
subdomain URLs. Org-repo branch is unchanged (hexorgs.pm is GKE and
doesn't enforce strict SAN matching).
@ericmj ericmj merged commit 102afdc into main May 29, 2026
31 checks passed
@ericmj ericmj deleted the hexdocs-subdomain-urls branch May 29, 2026 16:52
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.

1 participant