-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Change search "not found" links #142867
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
base: master
Are you sure you want to change the base?
Change search "not found" links #142867
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4919,11 +4919,12 @@ | |
}); | ||
} else if (query.error === null) { | ||
const dlroChannel = `https://doc.rust-lang.org/${getVar("channel")}`; | ||
const docsrsURL = `https://docs.rs/releases/search?query=${encodeURIComponent(query.userQuery)}`; | ||
Check failure on line 4922 in src/librustdoc/html/static/js/search.js
|
||
const duckduckgoURL = `https://duckduckgo.com/?q=${encodeURIComponent("rust " + query.userQuery)}`; | ||
Check failure on line 4923 in src/librustdoc/html/static/js/search.js
|
||
output.className = "search-failed" + extraClass; | ||
output.innerHTML = "No results :(<br/>" + | ||
"Try on <a href=\"https://duckduckgo.com/?q=" + | ||
encodeURIComponent("rust " + query.userQuery) + | ||
"\">DuckDuckGo</a>?<br/><br/>" + | ||
output.innerHTML = `No results in <code>${getVar("current-crate")}</code> :(<br/>` + | ||
`Search for <a href="${docsrsURL}">other crates</a>?<br/>` + | ||
`Or try on <a href="${duckduckgoURL}">DuckDuckGo</a>?<br/><br/>` + | ||
Comment on lines
+4925
to
+4927
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can apply some simple heuristics to hide this when it would be unhelpful. for example, if |
||
"Or try looking in one of these:<ul><li>The <a " + | ||
`href="${dlroChannel}/reference/index.html">Rust Reference</a> ` + | ||
" for technical details about the language.</li><li><a " + | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we're here we should probably disambiguate so people don't get results about the game (this happens to me sometimes)