rust-lang / rust-lang/docs.rs

Show "go to latest version" on crate details pages

Open
#1,093 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-frontend C-enhancement E-easy
Dominant language
Rust
Stars
1.2k
Forks
232
Avg merge
11h 35m
Merged PRs (30d)
60

Description

From #1089:

There is one remaining issue that I don't want to fix here; the "go to latest version" link doesn't appear on the non-rustdoc pages. The metadata used for rendering builds and source files doesn't currently pull enough details from the database for this, I think it might make the most sense to make both of them get the full CrateDetails and move the is_latest_version etc. checking into Tera helpers rather than being extra context variables, but that seems better done as a separate refactoring.

I think "go to latest version" on the crate details pages should link to the latest version's crate details page, rather than into the documentation (not sure whether linking directly to source/builds is worth it). It should be possible to simplify the "go to latest version" link on the doc pages as well to use the target-redirect rather than pre-calculating the path to go to, which should make it more consistent to implement across the different pages.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the crate details pages and the existing "go to latest version" link on doc pages, then trace how metadata for builds and source files is rendered. Read the CrateDetails, Tera helper, and target-redirect references in the issue to understand the intended shared path. Done means crate details pages link to the latest crate details page and the behavior is consistent across relevant pages.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.