External broken link prevention #5569
Replies: 1 comment 2 replies
-
Considering the isolated nature of each plugin, you would have to do the path-route mapping + linkify + broken links detection logic for every content plugin (docs, pages, blog), so I guess it could be hard. There's no way to know if a link is broken without building the entire site, so your plugin essentially builds the whole site🤦♂️ I personally can't see a better way to do this Still, the I'm all for this feature, but I think it may be better implemented in the core rather than as a plugin |
Beta Was this translation helpful? Give feedback.
-
Say your site has a page at
/oldpage
. You move it to/newpage
and you update all the links so there are no broken links.Well, no broken links on your site, but anyone else linking to it from the web will now be broken.
What I have in mind is when this happens, the site owner has to explicitly choose whether to add a redirect from oldpage -> newpage OR to explicitly accept that this external link is broken intentionally.
I think it can be achieved by a plugin that maintains a list of all the current URLs on a site (this list would be persisted in source-control and auto-updated during build). After every build, the new list of accessible URLs gets diff'd against this one, and any ones that are no longer present are highlighted and the owner forced to choose.
This "forced to choose" state could be as simple as a build failure, saying:
Starting this discussion to ask whether this sounds like a good approach, and whether anyone foresees any issues with it.
Beta Was this translation helpful? Give feedback.
All reactions