Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@angular/cli): change the url for doc search #16846

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/angular/cli/commands/doc-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ export class DocCommand extends Command<DocCommandSchema> {
/* tslint:disable-next-line:no-implicit-dependencies */
const currentNgVersion = require('@angular/core').VERSION.major;
domain = `v${currentNgVersion}.angular.io`;
} catch (e) {}
} catch (e) { }
}

let searchUrl = `https://${domain}/api?query=${options.keyword}`;

if (options.search) {
searchUrl = `https://www.google.com/search?q=site%3A${domain}+${options.keyword}`;
searchUrl = `https://${domain}/?search=${options.keyword}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that for archive version (i.e. older than the current stable), non-docs pages (including the home page) are redirected to /docs (losing the query params). So, this URL should be https://${domain}/docs?search=${options.keyword} 😅
(My bad for suggesting the wrong URL 😇)

I submitted #16856.

}

// We should wrap `open` in a new Promise because `open` is already resolved
Expand Down