FEATURE: Site setting to control search menu tip addition (#136)

This commit is contained in:
Mark VanLandingham 2023-06-05 09:39:31 -05:00 committed by GitHub
parent 04af2c4d33
commit 5a8bbc3f87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 10 deletions

View File

@ -30,17 +30,20 @@ export default {
} }
withPluginApi("0.8", (api) => initialize(api, container)); withPluginApi("0.8", (api) => initialize(api, container));
withPluginApi("0.12.6", (api) => {
api.addSearchSuggestion("in:docs");
const tip = { if (siteSettings.docs_add_search_menu_tip) {
label: "in:docs", withPluginApi("0.12.6", (api) => {
description: I18n.t("docs.search.tip_description"), api.addSearchSuggestion("in:docs");
clickable: true,
searchTopics: true, const tip = {
}; label: "in:docs",
api.addQuickSearchRandomTip(tip); description: I18n.t("docs.search.tip_description"),
}); clickable: true,
searchTopics: true,
};
api.addQuickSearchRandomTip(tip);
});
}
withPluginApi("1.2.0", (api) => { withPluginApi("1.2.0", (api) => {
if (siteSettings.navigation_menu !== "legacy") { if (siteSettings.navigation_menu !== "legacy") {

View File

@ -5,3 +5,4 @@ en:
docs_tags: "A list of tags to include in docs" docs_tags: "A list of tags to include in docs"
docs_add_solved_filter: "Adds a filter for solved topics -- requires Discourse Solved to be installed and enabled" docs_add_solved_filter: "Adds a filter for solved topics -- requires Discourse Solved to be installed and enabled"
docs_add_to_top_menu: "Adds a link to the top menu to navigate to the Docs view" docs_add_to_top_menu: "Adds a link to the top menu to navigate to the Docs view"
docs_add_search_menu_tip: "Adds the tip \"in:docs\" to the search menu random tips"

View File

@ -16,3 +16,6 @@ plugins:
docs_add_to_top_menu: docs_add_to_top_menu:
default: false default: false
client: true client: true
docs_add_search_menu_tip:
default: true
client: true