-
Notifications
You must be signed in to change notification settings - Fork 365
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
base: trunk
Are you sure you want to change the base?
Conversation
Co-authored-by: adamziel <[email protected]>
- 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 <[email protected]>
|
@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 <[email protected]>
Added an orphaned test page in commit 78525d1. The check now correctly fails: Exit code: 1 ✓ The test page ( |
Motivation for the change, related issues
Prevents orphaned documentation pages that exist in the repository but aren't linked in any sidebar menu, making them undiscoverable to users.
Implementation details
Script:
packages/docs/site/bin/check-orphan-pages.jsdocs/(excluding_fragments/)CI Integration: Added to
lint-and-typecheckjob in.github/workflows/ci.ymlFixes found:
developers/local-development/wp-nowpagedevelopers/xdebug/introductionsidebar entryTest validation: Added
main/orphaned-test-page.md- an intentionally orphaned page that demonstrates the check correctly identifies orphaned pages and fails the CI buildTesting Instructions (or ideally a Blueprint)
Run locally:
The check currently fails (as expected) due to the intentionally orphaned test page at
packages/docs/site/docs/main/orphaned-test-page.md. This demonstrates the CI check works correctly:Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.