Code Monkey home page Code Monkey logo

Comments (2)

syphar avatar syphar commented on August 21, 2024

I like the idea.
we probably would just have to define a new error type & page with the necessary information.

Also note another option:
when you switch platforms in a release and the other platform doesn't have the current file, we convert the URL into a search and run a rustdoc search on the other platform. Not sure if this would be a useful other option for this 404 page.

from docs.rs.

ibilalkayy avatar ibilalkayy commented on August 21, 2024

@kpreid Here is a suggestion.

How to Solve the Issue

  1. Design a New 404 Error Page:

    • Information Display: The 404 page should clearly state that the requested resource does not exist but that the package and version are valid.
    • Navigation Options: Provide direct links to:
      • The root documentation page for the current version.
      • A page to browse other versions of the package.
    • Previous Version Lookup (Stretch Goal):
      • Implement a feature to search for the most recent previous version where the resource was available and link to that version.
  2. Implementing Navigation Links:

    • Root Documentation Link: This can be achieved by extracting the base URL from the request and appending the version to navigate to the root documentation for that version.
    • Version Browsing Link: Provide a link to the package’s main page where users can select different versions to view.
    • Previous Version Lookup:
      • Implement logic to search through the version history of the package to find the last version where the resource existed. This might involve querying metadata or change logs.

Example 404 Page Design

Here’s a conceptual design for the improved 404 error page:


404 Not Found

The requested resource does not exist in the current version of the package.

Package and Version Information:

  • Package: example
  • Version: 0.18.0

Navigation Options:

(Optional) Previous Version with Resource:

  • The requested resource was available in version 0.17.0. [View documentation for this version]

from docs.rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.