Support Native Search (Ghost V5) (#465)

This commit is contained in:
ココロ 2022-08-19 04:50:48 +08:00 committed by GitHub
parent cb47498b48
commit 1ea6681f76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -33,6 +33,10 @@
"dark_mode_logo": {
"type": "image"
},
"enable_native_search": {
"type": "boolean",
"default": false
},
"search_api_key": {
"type": "text"
},

View File

@ -19,7 +19,7 @@ This header template is shared across all the pages.
{{@site.title}}
</a>
{{/if}}
<button class="m-icon-button in-mobile-topbar js-open-search" aria-label="{{t "Open search"}}">
<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>
</div>
@ -118,7 +118,7 @@ This header template is shared across all the pages.
</ul>
</nav>
<div class="m-nav__right">
<button class="m-icon-button in-menu-main js-open-search" aria-label="{{t "Open search"}}">
<button class="m-icon-button in-menu-main {{^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>
<div class="m-toggle-darkmode js-tooltip" data-tippy-content="{{t "Toggle dark mode"}}" tabindex="0">