Skip to content

Commit 9e58ffa

Browse files
authored
Change search "not found" links
1 parent 8051f01 commit 9e58ffa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/librustdoc/html/static/js/search.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4919,11 +4919,12 @@ ${item.displayPath}<span class="${type}">${name}</span>\
49194919
});
49204920
} else if (query.error === null) {
49214921
const dlroChannel = `https://doc.rust-lang.org/${getVar("channel")}`;
4922+
const docsrsURL = `https://docs.rs/releases/search?query=${encodeURIComponent(query.userQuery)}`;
4923+
const duckduckgoURL = `https://duckduckgo.com/?q=${encodeURIComponent("rust " + query.userQuery)}`;
49224924
output.className = "search-failed" + extraClass;
4923-
output.innerHTML = "No results :(<br/>" +
4924-
"Try on <a href=\"https://duckduckgo.com/?q=" +
4925-
encodeURIComponent("rust " + query.userQuery) +
4926-
"\">DuckDuckGo</a>?<br/><br/>" +
4925+
output.innerHTML = `No results in <code>${getVar("crate")}</code> :(<br/>` +
4926+
`Search for <a href="${docsrsURL}">other crates</a>?<br/>` +
4927+
`Or try on <a href="${duckduckgoURL}">DuckDuckGo</a>?<br/><br/>` +
49274928
"Or try looking in one of these:<ul><li>The <a " +
49284929
`href="${dlroChannel}/reference/index.html">Rust Reference</a> ` +
49294930
" for technical details about the language.</li><li><a " +

0 commit comments

Comments
 (0)