Skip to content

Conversation

@carols10cents
Copy link
Member

Don't show the link if there aren't any docs.rs builds as clicking on the link won't work then, but do still show the source link even if a non-docs.rs documentation link has been specified to enable review of the source exactly as crates.io serves it.

Don't show the link if there aren't any docs.rs builds as clicking on
the link won't work then, but do still show the source link even if a
non-docs.rs documentation link has been specified to enable review of
the source exactly as crates.io serves it.

get docsRsSourceLink() {
if (this.hasDocsRsLink) {
return `https://docs.rs/crate/${this.crateName}/${this.num}/source/`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can show the link more often.

from what I see, hasDocsRsLink is based on our status-json result (doc_status in there).

But we also have & host the source when:

  • it's a binary crate, or
  • the if the doc-build failed
  • when the build is in progress

The only edge cases here would be when the build is queued, or we didn't get the update from the registry yet.

I think you're good in just checking if you have a result from our status endpoint, no matter what you see in doc_status

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is also rust-lang/docs.rs#2762 where we would try to serve a nice page even for just queued releases

@Turbo87 Turbo87 added the C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-frontend 🐹 C-enhancement ✨ Category: Adding new behavior or a change to the way an existing feature works

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants