Invalid Link to Custom Page
The invalid link to custom page error indicates that a link points to a known custom page route that the plugin cannot validate with the same level of detail as regular documentation pages.
If needed, use the exclude option to ignore these errors for expected custom pages.
Example
Section titled “Example”For example, given the following project structure:
Directorysrc/
Directorycontent/
Directorydocs/
Directoryguides/
- setup.mdx
- getting-started.md
Directorypages/
- custom-page.astro
And the following content in src/content/docs/getting-started.md:
---title: Getting Started---
## Next Steps
- [Setup guide](/guides/setup/)- [Custom page](/custom-page/)Running a production build reports the following error:
╭─ getting-started.md ·7 | /custom-page/ · ╰── invalid link to custom page
╭─ ─╮· Found 1 invalid link in 1 file. ·╰─ ─╯How to fix
Section titled “How to fix”Use the exclude option to ignore these errors when links to custom pages are expected.
For this example:
-
Exclude
/custom-page/using theexcludeoption.starlightLinksValidator({exclude: ['/custom-page/'],})