Skip to content
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

broken links should break the build #1730

Open
Fil opened this issue Oct 8, 2024 · 11 comments
Open

broken links should break the build #1730

Fil opened this issue Oct 8, 2024 · 11 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@Fil
Copy link
Contributor

Fil commented Oct 8, 2024

  • 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)

@Fil Fil added enhancement New feature or request question Further information is requested labels Oct 8, 2024
@Martien
Copy link

Martien commented Nov 22, 2024

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.

@mbostock
Copy link
Member

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.

@Martien
Copy link

Martien commented Nov 22, 2024

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.

@Fil
Copy link
Contributor Author

Fil commented Nov 22, 2024

Having red links (for preview at least) and optionally breaking the build would give us the best of both worlds.

@Martien
Copy link

Martien commented Nov 25, 2024

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?

@mbostock
Copy link
Member

So that authors are aware of broken links.

@Martien
Copy link

Martien commented Nov 25, 2024

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?

@mbostock
Copy link
Member

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.

@Martien
Copy link

Martien commented Nov 25, 2024

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.

@mbostock
Copy link
Member

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.

@Fil
Copy link
Contributor Author

Fil commented Dec 2, 2024

As an additional option, remove the href attribute from red links (#1858 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants