expressjs / expressjs/expressjs.com

Compatibility with old `#` fragments

Open
#2,338 0 comments 1 reaction 0 assignees View on GitHub
design discuss enhancement
Dominant language
MDX
Stars
5.4k
Forks
2.3k
Avg merge
2d 23m
Merged PRs (30d)
14

Description

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 `id`s matching the old ones just like Node.js does (https://github.com/nodejs/doc-kit/issues/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 `id`s):

- 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 `id`s).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.