diff --git a/preview-src/ui-model.yml b/preview-src/ui-model.yml index 77650e17..7222f865 100644 --- a/preview-src/ui-model.yml +++ b/preview-src/ui-model.yml @@ -1,9 +1,10 @@ antoraVersion: 'dev-for-bonita-documentation-theme' site: keys: - nonProduction: false + forceDisplaySearchBar: false hideEditPageLinks: false hideNavbarComponentsList: false + nonProduction: false # Can be changed by setting the BONITA_THEME_URL environment variable when building url: http://localhost:5252 title: Bonita Documentation Theme Preview diff --git a/src/helpers/isSearchBarDisplayed.js b/src/helpers/isSearchBarDisplayed.js index 74a05f6b..70edcbbb 100644 --- a/src/helpers/isSearchBarDisplayed.js +++ b/src/helpers/isSearchBarDisplayed.js @@ -1,5 +1,7 @@ 'use strict' module.exports = (site, page) => { - return !(site.keys?.nonProduction || page.attributes?.['hide-search-bar'] || page.layout === '404') + return page.layout !== '404' && + !page.attributes?.['hide-search-bar'] && + (site.keys?.forceDisplaySearchBar || !site.keys?.nonProduction) }