api.dart.dev icon indicating copy to clipboard operation
api.dart.dev copied to clipboard

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

Open jamesderlin opened this issue 2 years ago • 3 comments
trafficstars

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 avatar Feb 13 '23 18:02 jamesderlin

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

jamesderlin avatar Feb 13 '23 18:02 jamesderlin

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

parlough avatar Feb 13 '23 18:02 parlough

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.

srawlins avatar Feb 13 '23 19:02 srawlins