Skip to content

Compatibility with old # fragments #2338

@krzysdz

Description

@krzysdz

In #2324 I'm fixing the URLs in our docs to point to appropriate sections in the docs. Other external resources (StackOverflow, GitHub comments, other websites) won't be updated and the links won't point them where they should.

While we could add elements with ids matching the old ones just like Node.js does (nodejs/doc-kit#697), this would not solve the problem. Old links look like /en/4x/api.html#res.send, but on the new website a link to the same section would be /en/5x/api/response/#ressendbody. The old URL (after 301 redirect) leads to the API overview page.

Fixing this would require (besides adding elements with matching ids):

  • going back to (or just adding) a single unified page with all API docs, or
  • adding a client-side script to the API overview pages that parses the fragment and based on the element before . redirects to express (#express*), application (#app*), request (#req*), response (#res*) or router (#router*) while keeping the fragment.

Fragment in guides also don't point to the same sections, but this is much less important and making it compatible with old URLs would not require any redirects or other complicated things (just hidden elements with old ids).

Metadata

Metadata

Assignees

No one assigned

    Labels

    designChange, update, or fix for site UI (not content)discussenhancement

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions