Skip to content

Commit

Permalink
feat: let display the search bar in preview (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbouffard authored May 5, 2023
1 parent 44c60ee commit ecda120
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion preview-src/ui-model.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/helpers/isSearchBarDisplayed.js
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit ecda120

Please sign in to comment.