dart-lang / api.dart.dev

Dart API docs
https://api.dart.dev
BSD 3-Clause "New" or "Revised" License
19 stars 17 forks source link

Would be nice if https://api.dart.dev/stable/search.html?q=... redirected the search #90

Open jamesderlin opened 1 year ago

jamesderlin commented 1 year ago

Describe the problem

Now that the Dart API documentation supports query-string searches, I can create a keyword search in my browser so that typing dart QUERY is automatically expanded to https://api.dart.dev/stable/2.19.2/search.html?q=QUERY. Yay!

However, I would prefer not to search against a specific version; I'd rather just search the latest stable documentation.

I tried making my keyword search instead expand to https://api.dart.dev/stable/search.html?q=QUERY, but that doesn't work. Even though removing the version number normally redirects to the latest version for concrete URLs (for example., https://api.dart.dev/stable/dart-async/Future-class.html automatically redirects to https://api.dart.dev/stable/2.19.2/dart-async/Future-class.html), removing the version number from the query URL instead redirects to https://api.dart.dev/stable/2.19.2/index.html.

Expected fix

https://api.dart.dev/stable/search.html?q=QUERY should redirect to https://api.dart.dev/stable/LATEST_VERSION/search.html?q=QUERY.

Additional context

No response

jamesderlin commented 1 year ago

(Oops, design is not really the right label for this. infrastructure, maybe?)

parlough commented 1 year ago

This might be a better issue for https://github.com/dart-lang/api.dart.dev, but this definitely makes sense.

\cc @devoncarew @srawlins since I'm not sure who handles that repository or implementation

srawlins commented 1 year ago

I agree this is probably a routing / infra FR for api.dart.dev, but I seem not to have the power to transfer the issue.