-
Notifications
You must be signed in to change notification settings - Fork 368
Add CI check for orphaned documentation pages #2896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: adamziel <205419+adamziel@users.noreply.github.com>
- Created check-orphan-pages.js script to detect orphaned docs - Added wp-now page to sidebar (was previously orphaned) - Fixed duplicate xdebug/introduction entry in sidebar - Added check-orphan-pages target to nx project config - Integrated check into CI workflow lint-and-typecheck job Co-authored-by: adamziel <205419+adamziel@users.noreply.github.com>
|
@copilot this seems quite manual. Is there no docusaurus plugin or otherwise an existing package we could use for this? |
I researched existing solutions and found: No existing Docusaurus plugin or package does this specific check. Docusaurus has Why a standalone script is better than a plugin:
The script is focused (218 lines), well-documented, and follows Node.js best practices. If you prefer a plugin approach, I can refactor it to use Docusaurus's Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot then please add an orphaned page in this PR to confirm the check will fail |
This intentionally orphaned page validates that the check-orphan-pages.js script correctly identifies pages not linked in any sidebar. Co-authored-by: adamziel <205419+adamziel@users.noreply.github.com>
Added an orphaned test page in commit 78525d1. The check now correctly fails: Exit code: 1 ✓ The test page ( |
|
The failed tests are unrelated to this PR, Cypress binaries somehow cannot be downloaded. |
Motivation for the change, related issues
Adds a new
CI Lint and Typecheckcheck to confirm all the documentation pages are linked to. This should prevent orphaned, undiscoverable pages when we forget to add a link to a sidebar menu.Intentionally orphaned pages are still supported via
orphan: truein the frontmatter, e.g. in01-wp-now.ymlTesting Instructions (or ideally a Blueprint)
Run locally:
Then create an orphaned test page, e.g. at
packages/docs/site/docs/main/orphaned-test-page.md, and re-run: