mirror of
https://github.com/open-webui/docs.git
synced 2026-11-05 01:38:13 +00:00
[PR #1376] [MERGED] docs: fail the build on broken Markdown file-path links #1345
Labels
No labels
bug
documentation
documentation
duplicate
enhancement
enhancement
good first issue
good first issue
good first issue
help wanted
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/docs#1345
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/docs/pull/1376
Author: @silentoplayz
Created: 9/2/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @Classic298
Base:
main← Head:docs/fail-build-on-broken-markdown-links📝 Commits (1)
3ad295fdocs: fail the build on broken Markdown file-path links📊 Changes
1 file changed (+3 additions, -0 deletions)
View changed files
📝
docusaurus.config.ts(+3 -0)📄 Description
Summary
Makes the build fail when a Markdown link written as a file-path points at a file that does not exist. Follows #1373 and #1374, which converted 123 relative links to the file-path form.
The default is
warn, so a Markdown link whose target has moved or been renamed prints a line during the build and ships anyway.onBrokenLinksis already set tothrow, but that validates the renderedhrefrather than the source link, so the two settings cover different things.232 links now use the file-path form, up from 109 before #1374. That form is only worth adopting if a moved target is caught, which is what this changes.
Related issue or discussion
No linked issue. Follows #1373 and #1374.
Checklist
Notes for reviewers
What this catches, and what it does not
I tested both link forms by pointing each at a file that does not exist and building.
[probe a](./this-file-does-not-exist.mdx)[probe b](./this-file-also-does-not-exist)So this guards the file-path form and nothing else. It would not have caught the 123 dead links fixed in #1373 and #1374, because those were written without an extension and this hook never inspects that form. What it does is keep the fix from rotting. Those links are now file-path links, so a renamed or moved target will stop the build rather than reaching the site.
Probe A reports it like this, which is enough to fix without hunting:
Config key
The installed
@docusaurus/coreis 3.9.2. The top-levelsiteConfig.onBrokenMarkdownLinksis deprecated there and logs a migration warning, so this goes inmarkdown.hooksinstead. The build confirms it, printing no deprecation warning.Verification
npm run buildon currentmainwith this setting passes. 419 pages, no broken Markdown links surfaced, no deprecation warning. I then added the two probe links above, rebuilt to confirm the setting actually fires, and reverted them. The only change in this PR is the three config lines.This PR was prepared with AI copilot assistance. I have thoroughly reviewed and manually tested it.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.