Improve performance by disabling custom search requests when native search is enabled
This commit is contained in:
parent
263d7938c6
commit
b2705f9d83
File diff suppressed because one or more lines are too long
@ -96,6 +96,12 @@
|
||||
// @license-end
|
||||
</script>
|
||||
|
||||
{{#if @custom.enable_native_search}}
|
||||
<script>
|
||||
const nativeSearchEnabled = true
|
||||
</script>
|
||||
{{/if}}
|
||||
|
||||
{{#if @custom.search_api_key}}
|
||||
<script>
|
||||
const ghostSearchApiKey = "{{@custom.search_api_key}}"
|
||||
@ -129,7 +135,9 @@
|
||||
{{{body}}}
|
||||
|
||||
{{!-- Search form --}}
|
||||
{{^if @custom.enable_native_search}}
|
||||
{{> search}}
|
||||
{{/if}}
|
||||
|
||||
{{!-- The footer --}}
|
||||
{{> footer}}
|
||||
|
@ -87,5 +87,5 @@
|
||||
"desktop": "assets/screenshot-desktop.jpg",
|
||||
"mobile": "assets/screenshot-mobile.jpg"
|
||||
},
|
||||
"version": "2.1.1"
|
||||
"version": "2.1.2"
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ version: "3"
|
||||
|
||||
services:
|
||||
ghost:
|
||||
image: ghost:5.22.1
|
||||
image: ghost:5.22.10
|
||||
container_name: ghost
|
||||
volumes:
|
||||
- ./..:/var/lib/ghost/content/themes/liebling:Z
|
||||
|
@ -66,7 +66,7 @@ $(() => {
|
||||
};
|
||||
|
||||
const trySearchFeature = () => {
|
||||
if (typeof ghostSearchApiKey !== 'undefined') {
|
||||
if (typeof ghostSearchApiKey !== 'undefined' && typeof nativeSearchEnabled === 'undefined') {
|
||||
getAllPosts(ghostHost, ghostSearchApiKey);
|
||||
} else {
|
||||
$openSearch.css('visibility', 'hidden');
|
||||
|
Loading…
Reference in New Issue
Block a user