From 6661140121959cbe74d50d413472e1f09e49c618 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Thu, 18 Dec 2025 16:06:59 -0500 Subject: [PATCH] Add a link to browse crate source on docs.rs 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. --- app/components/crate-sidebar.gjs | 6 +- app/models/version.js | 16 +++ e2e/routes/crate/version/source-link.spec.ts | 98 +++++++++++++++++++ .../routes/crate/version/source-link-test.js | 84 ++++++++++++++++ 4 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 e2e/routes/crate/version/source-link.spec.ts create mode 100644 tests/routes/crate/version/source-link-test.js diff --git a/app/components/crate-sidebar.gjs b/app/components/crate-sidebar.gjs index 5de1723a116..2f691091bc0 100644 --- a/app/components/crate-sidebar.gjs +++ b/app/components/crate-sidebar.gjs @@ -162,7 +162,7 @@ export default class CrateSidebar extends Component { {{/unless}} - {{#if (or this.showHomepage @version.documentationLink @crate.repository)}} + {{#if (or this.showHomepage @version.documentationLink @version.sourceLink @crate.repository)}}