Skip to content

docs-2979: fix broken doc anchors#2842

Merged
ctauchen merged 3 commits into
tigera:mainfrom
ctauchen:docs-2979-fix-anchors
Jul 8, 2026
Merged

docs-2979: fix broken doc anchors#2842
ctauchen merged 3 commits into
tigera:mainfrom
ctauchen:docs-2979-fix-anchors

Conversation

@ctauchen

@ctauchen ctauchen commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

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

  • Retarget: point the link at the current heading when one clearly matches (case, singular/plural, reworded, product rename). Verified against the built page's real anchor ids.
  • Neutralize when the section was removed: unlink same-page links (keep the text); drop the fragment on cross-page links (keep the page link).

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:

  • #selectors and #httpmatch in _includes/content/ partials (_entityrule.mdx, _rule.mdx).
  • API type refs in _api.mdx (for example operator.tigera.io/v1.*, tlsterminatedroute).
  • Component anchors (private-registry image path, some Felix CRD fields).

They need per-page handling. onBrokenAnchors stays '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.

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>
Copilot AI review requested due to automatic review settings July 8, 2026 10:23
@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for calico-docs-preview-next ready!

Name Link
🔨 Latest commit 10c7774
🔍 Latest deploy log https://app.netlify.com/projects/calico-docs-preview-next/deploys/6a4e2da94a305f00085d337b
😎 Deploy Preview https://deploy-preview-2842--calico-docs-preview-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview succeeded!

Built without sensitive environment variables

Name Link
🔨 Latest commit 10c7774
🔍 Latest deploy log https://app.netlify.com/projects/tigera/deploys/6a4e2da9988ac30008863eb7
😎 Deploy Preview https://deploy-preview-2842--tigera.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 73 (🔴 down 20 from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

ctauchen and others added 2 commits July 8, 2026 11:44
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>
@ctauchen ctauchen marked this pull request as ready for review July 8, 2026 11:08
@ctauchen ctauchen requested a review from a team as a code owner July 8, 2026 11:08
@ctauchen ctauchen merged commit ec7d290 into tigera:main Jul 8, 2026
10 of 11 checks passed
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.

2 participants