UX: Add in:docs quick tip in search widget (#61)

This commit is contained in:
Penar Musaraj 2021-10-12 10:11:29 -04:00 committed by GitHub
parent ac9d01dc18
commit bfed4ba324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -32,13 +32,21 @@ export default {
initialize(container) {
withPluginApi("0.8", (api) => initialize(api, container));
withPluginApi("0.11.7", (api) => {
withPluginApi("0.12.6", (api) => {
const siteSettings = container.lookup("site-settings:main");
if (!siteSettings.docs_enabled) {
return;
}
api.addSearchSuggestion("in:docs");
const tip = {
label: "in:docs",
description: I18n.t("docs.search.tip_description"),
clickable: true,
searchTopics: true,
};
api.addQuickSearchRandomTip(tip);
});
},
};

View File

@ -17,6 +17,7 @@ en:
other: "%{count} results found"
placeholder: "Search for topics"
clear: "Clear"
tip_description: "Search in docs"
topic:
back: "Go back"
navigate_to_topic: "View the discussion on this topic"