Skip to content

fix(docs): eliminate broken-link build warnings - #7

Merged
zackkatz merged 2 commits into
mainfrom
fix/broken-links
Jun 16, 2026
Merged

fix(docs): eliminate broken-link build warnings#7
zackkatz merged 2 commits into
mainfrom
fix/broken-links

Conversation

@zackkatz

@zackkatz zackkatz commented Jun 16, 2026

Copy link
Copy Markdown
Member

What

Two root causes behind the Docusaurus broken-link warnings (5,988 on a full build):

  1. Nav links to docless products (~5,750 — one per page). The nav helpers (getProductsByCategory/getFreeProducts/getThirdPartyProducts) linked every configured product, including block-mcp and gravitysearch, which have no generated docs. Now filtered to products_with_docs (the same existence check already used elsewhere).
  2. @since version links (222). Both the API (renderSinceTags) and hooks generators linked @since X to since/<version>/ pages that are never generated. Now rendered as plain version text.

Verified

  • Regenerated gravityview API docs: 0 ../../../since/ links (was many). renderSinceTags is the only since-link emitter; no others remain.
  • Nav filter drops exactly block-mcp + gravitysearch (35 → 33 product links).
  • Generators pass node --check; tags frontmatter generation unaffected.

Residual (tiny, separate)

~4 cross-reference #anchor warnings on generated API class pages remain (e.g. #as_configuration) — a distinct, low-volume issue not addressed here.

Independent of the tokens/full-GF PRs; general site fix.

Summary by CodeRabbit

Bug Fixes

  • Navigation links for products without generated documentation are now filtered from the menu to prevent broken links in the documentation.
  • Version reference links in generated API documentation have been corrected—version numbers now display as plain text instead of creating non-functional links.
  • PHP @see tag entries now link to the correct owning class page (without method anchors) when class URLs are available.

- Filter nav helpers to products with generated docs (drops broken
  /docs/block-mcp/ and /docs/gravitysearch/ links rendered on every page).
- Render @SInCE as plain text in the API and hooks generators; per-version
  since/<version>/ index pages are never generated, so the links 404'd.
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6c6d0fae-df95-4d28-9efe-13fd8ba563a7

📥 Commits

Reviewing files that changed from the base of the PR and between d3f9580 and d77e291.

📒 Files selected for processing (1)
  • scripts/generate-php-api.mjs

Walkthrough

Three files are updated to prevent broken links. docusaurus.config.js computes a Set of product IDs with existing doc directories and applies it as a filter in all three nav-building helpers. Two doc-generation scripts (generate-hooks.mjs, generate-php-api.mjs) remove logic that produced relative markdown links to "since" version pages, replacing them with plain text. Additionally, generate-php-api.mjs updates method @see link generation to target class pages directly instead of non-existent method anchors.

Changes

Fix broken links in nav and generated docs

Layer / File(s) Summary
Filter nav helpers to products with existing docs
docusaurus.config.js
Adds product_ids_with_docs Set built from existing docs/{product.id} directories. getProductsByCategory, getFreeProducts, and getThirdPartyProducts each gain a .filter() against this Set to exclude products without docs.
Remove since-version links from hook generation
scripts/generate-hooks.mjs
addTagsToHooks no longer rewrites "### Since" list entries into relative markdown links; version entries remain as plain text.
Fix broken links in PHP API generation
scripts/generate-php-api.mjs
renderSinceTags() emits each @since version as backticked plain text instead of a computed relative link. renderSeeAlsoSection() links method @see entries directly to the class page instead of appending method anchors that may not exist.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: eliminating broken-link build warnings. It accurately reflects the PR's primary objective of fixing Docusaurus broken-link warnings across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/broken-links

Comment @coderabbitai help to get the list of available commands and usage tips.

An @see-referenced method is frequently not a rendered heading on the target
class page (not in its public set), so #method anchors 404. Link to the class
page (always exists). Eliminates the residual broken-anchor warnings.
@zackkatz
zackkatz merged commit e70436a into main Jun 16, 2026
1 check passed
@zackkatz
zackkatz deleted the fix/broken-links branch June 16, 2026 22:19
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