refactor(docs): convert absolute coder/coder blob/tree/main links to relative (DOCS-351)#26341
Open
nickvigilante wants to merge 1 commit into
Conversation
Docs preview📖 View docs preview for |
8b8e2d0 to
3f501cb
Compare
3f501cb to
2b63e14
Compare
…relative (DOCS-351) Replaces 121 absolute github.com/coder/coder/(blob|tree)/main/<path> links across 39 markdown files with relative paths computed from each doc file's directory to the target. Line anchors and query strings are preserved. After this lands AND DOCS-349 (coder.com rewriter classifier fix) deploys, these links will follow the displayed docs version: - /docs/install/docker -> https://github.com/coder/coder/blob/v2.34.1/compose.yaml - /docs/@v2.30.0/install/docker -> https://github.com/coder/coder/blob/v2.30.0/compose.yaml - /docs/@main/install/docker -> https://github.com/coder/coder/blob/main/compose.yaml Pre-existing dead link surfaced by the conversion: - docs/about/contributing/CONTRIBUTING.md:7 -> ../../../nix The original absolute URL https://github.com/coder/coder/tree/main/nix already returns 404 today; this repo's Nix entrypoints are flake.nix and shell.nix at the root, not a nix/ directory. Out of scope for this refactor; tracked as a separate fix-as-you-go item. Out of scope: - 10 SHA-pinned (blob|tree)/<sha> links (DOCS-352). - 3 dead docs-backend-contrib-guide branch refs (DOCS-350). - 4 coder/code-server (blob|tree)/main links (filed separately). Generated by Coder Agents on Nick Vigilante's behalf.
2b63e14 to
0e76ebb
Compare
bpmct
approved these changes
Jun 12, 2026
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.
Closes DOCS-351.
Warning
DO NOT MERGE until DOCS-349 (coder.com#877) has shipped to production and baked for at least one Vercel cycle.
Without DOCS-349, the relative links in this PR resolve to broken docs-route URLs (
/docs/helm/coder/values.yaml-> 404) instead of GitHub URLs tagged with the displayed docs version. DOCS-349 fixes the rewriter to classify these as GitHub blob/tree URLs with the page's resolved ref.TL;DR
Converts 121 absolute
https://github.com/coder/coder/(blob|tree)/main/<path>links across 39 docs markdown files to relative paths. After this lands AND DOCS-349 deploys, every one of these links will follow the displayed docs version (mainline tag on bare URLs, explicit tag on/@vX.Y.Z/,mainon/@main/) instead of always pointing tomain.Why
Today a reader on
/docs/@v2.30.0/install/dockerfollows acompose.yamllink and arrives atmain'scompose.yaml, which doesn't necessarily match what the docs page describes. Helm values, Terraform templates, and source-code references in particular drift across versions. The fix is to let the coder.com rewriter substitute the page's resolved ref into the URL; that only works on relative links.Example payoff (post-DOCS-349)
main)/docs/install/dockerhttps://github.com/coder/coder/blob/main/compose.yamlhttps://github.com/coder/coder/blob/v2.34.1/compose.yaml(today's mainline)/docs/@v2.30.0/install/dockerhttps://github.com/coder/coder/blob/v2.30.0/compose.yaml/docs/@main/install/dockerhttps://github.com/coder/coder/blob/main/compose.yamlScope
tree/main(directories) andblob/main(files), both flipped to relative paths.#L23-L24) and query strings preserved verbatim.os.path.relpath. Any path starting at the same directory or below gets a./prefix; otherwise../chains.Rebased on main
The branch was rebased onto
mainafter the DOCS-350 hotfix (#26339) merged. The hotfix repointed 3docs-backend-contrib-guiderefs inbackend.mdtomain, which then needed the samemain-> relative conversion this PR is doing for the other 121 links. The conflict was resolved by reapplying the mechanical conversion tobackend.mdafter taking the hotfix's content. Net result: those 3 links land here as relative, same as everything else. New HEAD3f501cb622.Inline fix folded in: dead
nixlinkdocs/about/contributing/CONTRIBUTING.md:7->../../../nixThe original absolute URL
https://github.com/coder/coder/tree/main/nixalready returned 404 today. Repointed toflake.nix(modern Nix entrypoint, what the prose "Nix environment" semantically refers to). Closes DOCS-357 here since thecheck-docsLinkspector job surfaced it during rebase; cheaper to fix inline than in a separate single-line PR.Out of scope (filed separately)
docs-backend-contrib-guidebranch refs inbackend.md(#26339, merged).(blob|tree)/<sha>links pending intent review.(blob|tree)/mainlinks incoder/code-server).coder/code-server/docs/CONTRIBUTING.md(independent of this PR).Not triggering
/coder-agents-reviewDocs-only edit; per
AGENTS.mdthe bot review is reserved for product/CI changes.Pre-mortem
..)nixlink above).#L<n>-L<m>cases inairgap.mdandspeed-up-templates.md.Validation
114 newly-relative paths verified to resolve to existing repo files (Python
os.path.existscheck on each computed target).Decision log + planning context
Why relative over
(blob|tree)/{{currentDocsVersion}}/...templating: relative paths require zero markdown-system support and zero upstream churn beyond this one PR. Templating would require a preprocessor oncoder.comside AND a convention upstream authors have to remember; relative paths just work in a plain editor andgithub.com's own renderer too.Why
./prefix on same-directory targets: makes the conversion grep-able later (grep -E '\((\.\./|\./)').Why preserve
#L<n>-L<m>anchors verbatim: the anchor is meaningful to the linked file's content, not to the URL form; keeping it as-is preserves authorial intent. If the file later changes such that the line range drifts, that's a different problem the SHA-pin audit (DOCS-352) will surface.Generated by Coder Agents on @nickvigilante's behalf.
Drive-by external link fix folded in
docs/about/contributing/CONTRIBUTING.md:296citedhttps://reflectoring.io/meaningful-commit-messages/which is returning HTTP 503 (the host appears to be down site-wide right now).check-docsLinkspector flagged it after the rebase. Replaced withhttps://cbea.ms/git-commit/(Chris Beams' canonical "If applied, this commit will..." article, confirmed 200), which is the original source of the rule the prose recites anyway.