docs-2979: fix broken doc anchors#2842
Conversation
Fix two broken same-page anchors on the Kubernetes default-deny pages across all products and versions: - #crate-a-default-deny-network-policy -> #create-a-default-deny-network-policy (typo) - #create-a-global-default-deny-network-policy -> #create-a-global-default-deny-policy (heading is 'Create a global default deny policy', no 'network') Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for calico-docs-preview-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview succeeded!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Fixes broken in-page anchors in the “Kubernetes default deny” documentation across Calico OSS, Enterprise, and Cloud (including several versioned doc sets), reducing Docusaurus broken-anchor warnings and improving in-page navigation.
Changes:
- Corrects a typo in a TOC fragment (
#crate-…→#create-…) so the link matches the generated heading anchor. - Updates the “global default deny” TOC fragment to match the existing section heading anchor (
…-network-policy→…-policy). - Normalizes the “How to” list formatting (removes indentation that could cause Markdown to render the list incorrectly).
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| calico/network-policy/get-started/kubernetes-default-deny.mdx | Fixes “How to” fragment links for local headings in Calico OSS doc. |
| calico-enterprise/network-policy/beginners/kubernetes-default-deny.mdx | Fixes “How to” fragment links for local headings in Calico Enterprise doc. |
| calico-enterprise_versioned_docs/version-3.23-2/network-policy/beginners/kubernetes-default-deny.mdx | Same anchor fixes applied to the 3.23-2 versioned Enterprise doc. |
| calico-enterprise_versioned_docs/version-3.22-2/network-policy/beginners/kubernetes-default-deny.mdx | Same anchor fixes applied to the 3.22-2 versioned Enterprise doc. |
| calico-enterprise_versioned_docs/version-3.21-2/network-policy/beginners/kubernetes-default-deny.mdx | Same anchor fixes applied to the 3.21-2 versioned Enterprise doc. |
| calico-enterprise_versioned_docs/version-3.20-2/network-policy/beginners/kubernetes-default-deny.mdx | Same anchor fixes applied to the 3.20-2 versioned Enterprise doc. |
| calico-cloud/network-policy/beginners/kubernetes-default-deny.mdx | Fixes “How to” fragment links for local headings in Calico Cloud doc. |
| calico-cloud_versioned_docs/version-22-2/network-policy/beginners/kubernetes-default-deny.mdx | Same anchor fixes applied to the 22-2 versioned Cloud doc. |
| calico_versioned_docs/version-3.32/network-policy/get-started/kubernetes-default-deny.mdx | Same anchor fixes applied to the 3.32 versioned OSS doc. |
| calico_versioned_docs/version-3.31/network-policy/get-started/kubernetes-default-deny.mdx | Same anchor fixes applied to the 3.31 versioned OSS doc. |
| calico_versioned_docs/version-3.30/network-policy/get-started/kubernetes-default-deny.mdx | Same anchor fixes applied to the 3.30 versioned OSS doc. |
| calico_versioned_docs/version-3.29/network-policy/get-started/kubernetes-default-deny.mdx | Same anchor fixes applied to the 3.29 versioned OSS doc. |
| - [Create a default deny network policy](#crate-a-default-deny-network-policy) | ||
| - [Create a global default deny network policy](#create-a-global-default-deny-network-policy) | ||
| - [Create a default deny network policy](#create-a-default-deny-network-policy) | ||
| - [Create a global default deny network policy](#create-a-global-default-deny-policy) |
There was a problem hiding this comment.
Agreed — the anchor fragment is correct; this is a cosmetic mismatch between the TOC link text ("…network policy") and the heading ("Create a global default deny policy"). This PR is already merged, so rather than reopen it I've noted the text alignment on DOCS-2980 to ride along with the remaining default-deny/anchor cleanup.
| - [Create a default deny network policy](#crate-a-default-deny-network-policy) | ||
| - [Create a global default deny network policy](#create-a-global-default-deny-network-policy) | ||
| - [Create a default deny network policy](#create-a-default-deny-network-policy) | ||
| - [Create a global default deny network policy](#create-a-global-default-deny-policy) |
There was a problem hiding this comment.
Agreed — the anchor fragment is correct; this is a cosmetic mismatch between the TOC link text ("…network policy") and the heading ("Create a global default deny policy"). This PR is already merged, so rather than reopen it I've noted the text alignment on DOCS-2980 to ride along with the remaining default-deny/anchor cleanup.
| - [Create a default deny network policy](#crate-a-default-deny-network-policy) | ||
| - [Create a global default deny network policy](#create-a-global-default-deny-network-policy) | ||
| - [Create a default deny network policy](#create-a-default-deny-network-policy) | ||
| - [Create a global default deny network policy](#create-a-global-default-deny-policy) |
There was a problem hiding this comment.
Agreed — the anchor fragment is correct; this is a cosmetic mismatch between the TOC link text ("…network policy") and the heading ("Create a global default deny policy"). This PR is already merged, so rather than reopen it I've noted the text alignment on DOCS-2980 to ride along with the remaining default-deny/anchor cleanup.
Fix broken anchors where the target heading still exists under a different slug: case fixes, singular/plural, small typos, and reworded headings (verified against the built page's real heading ids). 56 links across 50 files, including next. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Retarget broken anchors to their current heading, or neutralize when the target section was removed (unlink same-page links; drop the fragment on cross-page links, keeping the page link). Verified against built-page anchor ids. Covers all built versions plus next. Reduces broken anchors from 329 to 72. The remainder live in shared partials and component/generated reference anchors (e.g. #httpmatch, #selectors, API type refs) whose validity varies by including page; these need per-page handling and are left for follow-up. onBrokenAnchors stays 'warn' (DOCS-2978) until they are resolved. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Closes DOCS-2979 (partial — see residual).
What this does
Fix broken anchors found by a build with
onBrokenAnchors: 'warn'(329 broken links on 219 pages).Result
Broken anchors: 329 → 72, verified by a rebuild. Fixes cover all built versions plus
next.How anchors were fixed
Residual (72, follow-up)
These live in shared partials and generated reference anchors. The anchor is valid on some including pages and missing on others, so one edit cannot fix them without breaking the valid ones:
#selectorsand#httpmatchin_includes/content/partials (_entityrule.mdx,_rule.mdx)._api.mdx(for exampleoperator.tigera.io/v1.*,tlsterminatedroute).They need per-page handling.
onBrokenAnchorsstays'warn'(DOCS-2978) until they are fixed, so nothing is blocked.How to validate
Build with
onBrokenAnchors: 'warn'and confirm the count is about 72 and the build still succeeds. Spot-check a few retargets against the target page headings.