Closed shincurry closed 2 years ago
Thanks!
This looks good, however, there are a couple of things that can be changed in order to merge this PR:
The code added in the file default.hbs
is not really necessary, you can remove it
In the file partials/header.hbs
the search button will be rendered twice in case the new custom setting is enabled because the current button will be still there:
<button class="m-icon-button in-mobile-topbar js-open-search" aria-label="{{t "Open search"}}">
<span class="icon-search" aria-hidden="true"></span>
</button>
{{#if @custom.enable_native_search}}
<button class="m-icon-button in-mobile-topbar" data-ghost-search aria-label="{{t "Open search"}}">
<span class="icon-search" aria-hidden="true"></span>
</button>
{{/if}}
I would suggest to do something like this:
<button class="m-icon-button in-mobile-topbar {{^if @custom.enable_native_search}}js-open-search{{/if}}" {{#if @custom.enable_native_search}}data-ghost-search{{/if}} aria-label="{{t "Open search"}}">
<span class="icon-search" aria-hidden="true"></span>
</button>
This way you avoid duplicated code and the button will be rendered only once.
Support Ghost official Native Search feature. #462
enable_native_search (Enable native search)
in Site-wide group