framework
framework copied to clipboard
broken links should break the build
- is this an option? or an opt-in for some projects only?
- the broken links detection didn't see that I was missing trailing slashes, can we fix that?
(ref #1729)
Not sure if this this about broken links in pages. If it is, please consider support for red links, as mentioned in #1828.
I do see those red links flaying by when npm run build.
I think red links make sense in a wiki context where you can click on the link to instantiate the page. But given that Framework is a static site generator and not a wiki, and hence there’s no way to edit the site or page when viewing the page, I think breaking the build is more appropriate than rendering stylized broken links.
True. I was not thinking of being able to click on the link to instantiate the page, because the site is read-only for visitors.
Then again, I would like a visual clue about any broken links. At times, I know that I will create the page that a link refers to, and I don’t want to have to go back later and add that link. Foresight, if you will.
It feels natural for me to add a [[link]] here and there when writing a page. Just because I know that the realisation of that future page is around the corner.
Thanks again for your reply. And wishing you a good weekend, again.
Having red links (for preview at least) and optionally breaking the build would give us the best of both worlds.
I am interested to learn why broken links should break the build. What is the rationale? I mean, the author(s) of the site are responsible for its content, right?
So that authors are aware of broken links.
Right. But the authors can already be aware of broken links as they are listed during the build. This does not imply that the build must break, too, right?
In typical builds, there are hundreds if not thousands of lines of output, so it can be easy to miss when a broken link is issued only as a warning. Furthermore with continuous integration/deployment, humans often don’t look at the output at all; we need an automated signal to notify authors when something is broken, rather than just another line of text. Furthermore, we want to prevent the broken site from being deployed, so that developers can fix the link before users see it.
I agree.
But what if the ultimate responsible person – like a product manager or business owner – wants those broken links to be deployed, for whatever reason. Should there be an option to turn that on or off?
Enfin, I want to be careful with your time, so I’m happy to close the conversation. I understand what you are saying and I agree with it, yet see it as a partial solution to break the build.
Thanks again for your time and wish you a perfect day.
Yes, we could provide a way to opt-out of this behavior. At a minimum, I expect using the rel="external" technique would work, as we already use that to opt-out of link normalization.
As an additional option, remove the href attribute from red links (https://github.com/observablehq/framework/discussions/1858#discussioncomment-11437041).