Skip to content

Fix broken anchors and links found by check-links --check-anchors - #1861

Closed
marcleblanc2 wants to merge 1 commit into
mainfrom
fix-broken-links-and-anchors
Closed

Fix broken anchors and links found by check-links --check-anchors#1861
marcleblanc2 wants to merge 1 commit into
mainfrom
fix-broken-links-and-anchors

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Linear FE-499: Fix doc site issues

Original all-in-one PR, being split into per-bucket PRs under FE-499 for easier review: #1864 (mechanical slug drift), #1865 (dead sections), #1866 (moved pages), #1867 (markup), #1868#1872 (reworded headings, by docs area). Kept for reference until the batch lands; not meant to merge. Fixes every broken internal link and #anchor reported by npm run check-links -- --check-anchors (the checker from #1858, with its fence-stripping and duplicate-route fixes). 123 files, links only, no prose rewrites beyond a few unlinked phrases.

What changed (buckets of broken links)

  • Renamed / mistyped anchors
    • Corrected to the slug the heading actually produces (#index-jobs#index_jobs, #kubernetes#kubernetes-helm, #nginx-ssl-https-configuration#nginx-sslhttps-configuration, alert/dashboard slugs with underscores, #Literal-search-default#keyword-search-default, etc.)
  • Moved content relinked
    • /admin/faq#…/self-hosted/faq#…, docker-compose anchors → /self-hosted/deploy/docker-compose/{configuration,operations}, kustomize file anchors → /self-hosted/deploy/kubernetes/kustomize#step-3-set-up-the-configuration-files, #template / #base → the deploy-sourcegraph-k8s directories on GitHub
  • Dead sections
    • Anchor dropped, page link kept
  • href="#" QuickLink placeholders
    • On the Kubernetes pages now point at the page they describe
  • Corrupted markup
    • [search.largeF[iles](...) and The o)rder in technical-changelog.mdx; `"true``` / `"*``` inline code in batch-spec-yaml-reference.mdx (these stray backticks also broke the checker's fence tracking); stray " in an anchor in kubernetes/troubleshoot.mdx.

Follow-ups (not in this PR)

1 - Links into the site-config / code-host JSON schema (/admin/config/site-config#search.largeFiles, /admin/code-hosts/github#rateLimit, …) are left as-is: the schema renders as a code block with no per-key anchors, so the fix belongs in the site, not the docs. The checker still reports these 24 anchors.

2 - Three routes have two source files, and the site serves the first one glob order returns; the other is unreachable:

  • cli/references/auth: auth.mdx (served) vs auth/index.mdx (richer, links subcommands)
  • cli/references/codeowners: same pattern
  • self-hosted/deploy/kubernetes/kustomize: kustomize.mdx (served) vs kustomize/index.mdx (concept doc, shadowed since 2024)

Each pair should be merged or one deleted. Reported in Slack thread.

Verify

npm run check-links -- --check-anchors

Amp threads

@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 7, 2026 10:24pm UTC

Request Review

- [Other](/admin/auth/saml/generic)

For advanced SAML configuration options, see the [`saml` auth provider documentation](/admin/config/site-config#saml).
For advanced SAML configuration options, see the [`saml` auth provider documentation](/admin/auth/saml).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link is intended to go do the site config schema section for saml, but that's broken because the site config schema is a JSON blob, and markdown headers aren't supported inside a giant JSON blob.

Linking instead to the saml docs page is not the intended path, but I'm not sure what else to do here.

@marcleblanc2
marcleblanc2 marked this pull request as draft September 7, 2026 22:06
@marcleblanc2
marcleblanc2 force-pushed the fix-broken-links-and-anchors branch 2 times, most recently from 41564a1 to 09fac9a Compare September 7, 2026 22:09
@marcleblanc2
marcleblanc2 force-pushed the fix-broken-links-and-anchors branch from 09fac9a to 2e551e4 Compare September 7, 2026 22:22
marcleblanc2 added a commit that referenced this pull request Sep 11, 2026
Linear [FE-499: Fix doc site
issues](https://linear.app/sourcegraph/issue/FE-499/fix-doc-site-issues)

Smaller, more easily reviewed subset of fixes from
#1861

Markup, not link targets:
- `docs/batch-changes/batch-spec-yaml-reference.mdx`: `` `"true``` ``
and `` `"*``` `` — a stray backtick broke the inline code and swallowed
the rest of the line
- `docs/technical-changelog.mdx`: a stray `)` in "o)rder" left over from
a mangled link
- `docs/self-hosted/deploy/kubernetes/configure.mdx`, `operations.mdx`:
`<QuickLink href="#">` placeholders now point at the page they describe

## Verification

Old links point at the current production site so you can see the
breakage; new links point at the preview and land on the heading.

Checked 2 changed links against
https://sourcegraph-docs-git-fix-link-markup-sourcegraph-f8c71130.vercel.app:
2 resolve, 0 fail.
Page rendered = the target page's first heading id is present (the 404
page never has it); Anchor = the #fragment is an id on the page. Old
links point at the current site.

<details><summary>All 2 links</summary>

| File containing the link | Old link (broken today) | New link
(preview) | Page rendered | Anchor found |

|--------------------------|-------------------------|--------------------|---------------|--------------|
| `docs/self-hosted/deploy/kubernetes/configure.mdx` |
[`#`](https://sourcegraph.com/docs/self-hosted/deploy/kubernetes/configure)
|
[`/self-hosted/deploy/kubernetes/configure`](https://sourcegraph-docs-git-fix-link-markup-sourcegraph-f8c71130.vercel.app/self-hosted/deploy/kubernetes/configure)
| ✅ | — |
| `docs/self-hosted/deploy/kubernetes/operations.mdx` |
[`#`](https://sourcegraph.com/docs/self-hosted/deploy/kubernetes/operations)
|
[`/self-hosted/deploy/kubernetes/operations`](https://sourcegraph-docs-git-fix-link-markup-sourcegraph-f8c71130.vercel.app/self-hosted/deploy/kubernetes/operations)
| ✅ | — |

</details>

## Amp threads

- [Docs - Fix broken heading
links](https://ampcode.com/threads/T-01a07623-9d65-7356-96b8-2bebb31ffa5a)
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