docs: Replace gh pages with redirects to otel.io registry - #2287
docs: Replace gh pages with redirects to otel.io registry#2287thompson-tomo wants to merge 6 commits into
Conversation
Updated GitHub Actions workflow for deploying to Pages with specific version tags for actions.
chalin
left a comment
There was a problem hiding this comment.
Thanks @thompson-tomo. I tested the deployment on your fork and it works as well as GitHub Pages allows: browsers get redirected to the registry from any old URL, and the workflow is tidy (pinned SHAs, minimal permissions, persist-credentials: false).
One optional, non-blocking idea: per-gem redirects. All old URLs currently land on the generic registry page, where readers must re-find their gem. Two cheap upgrades:
-
Check in a static stub per gem at
docs/github_pages/GEM_NAME/latest/index.htmlredirecting tohttps://rubydoc.info/gems/GEM_NAME. Being real files, these are served with a 200 status, and readers land on their gem's actual API docs. -
In
404.html, parse the path to route deep links per gem:const m = location.pathname.match(/^\/opentelemetry-ruby\/([\w-]+)\//); location.replace(m ? `https://rubydoc.info/gems/${m[1]}` : 'https://opentelemetry.io/ecosystem/registry/?language=ruby');
Either way, (RS)LGTM.
|
Thanks @chalin, i have made the changes to the 404 page as suggested. I have not bothered with a static per gem page as most visitors will also be passing a version string & often also additional path arguments as that is what was previously used. Hence the static page wouldn't be hit. Thanks again |
Closes #1435
Instructions on merge steps based on testing done in my fork: