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

Conversation

santoshyadavdev
Copy link
Contributor

Fixes #16840

Copy link
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Feb 6, 2020
@dgp1130 dgp1130 merged commit 688db35 into angular:master Feb 6, 2020
@dgp1130
Copy link
Collaborator

dgp1130 commented Feb 6, 2020

Merged to patch branch 9.0.x as well.

gkalpak added a commit to gkalpak/angular-cli that referenced this pull request Feb 6, 2020
In angular#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).
}

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.

dgp1130 pushed a commit that referenced this pull request Feb 7, 2020
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).
dgp1130 pushed a commit that referenced this pull request Feb 7, 2020
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 1beb582)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong request for ng doc -s
5 participants