From 5c0fc6870fafd732566eb5fd7f1ce7ded51bc878 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Thu, 6 Feb 2020 23:59:16 +0200 Subject: [PATCH] fix(@angular/cli): fix the URL for doc search In #16846, the URL for docs search was updated to point to the corresponding vX.angular.io website (with an appropriate query for the search). However, on the archive versions of the website (i.e. versions older than the current stable), non-docs pages (including the home page) are redirected to `/docs` (losing the query params). This commit fixes the URL to include `/docs`, so that it is not redirected (and preserve the query params that will trigger the search). (cherry picked from commit 1beb5820504012a8b520d43782d37bb110b15e9b) --- packages/angular/cli/commands/doc-impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/angular/cli/commands/doc-impl.ts b/packages/angular/cli/commands/doc-impl.ts index 654c3ffc2e54..587d760c3346 100644 --- a/packages/angular/cli/commands/doc-impl.ts +++ b/packages/angular/cli/commands/doc-impl.ts @@ -47,7 +47,7 @@ export class DocCommand extends Command { let searchUrl = `https://${domain}/api?query=${options.keyword}`; if (options.search) { - searchUrl = `https://${domain}/?search=${options.keyword}`; + searchUrl = `https://${domain}/docs?search=${options.keyword}`; } // We should wrap `open` in a new Promise because `open` is already resolved