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
12
default.hbs
12
default.hbs
@ -75,7 +75,7 @@
|
|||||||
{{!-- This #block helper will inject a stylesheet for a specific page --}}
|
{{!-- This #block helper will inject a stylesheet for a specific page --}}
|
||||||
{{{block "styles"}}}
|
{{{block "styles"}}}
|
||||||
|
|
||||||
{{!-- This #block helper will pull data from the hero partial
|
{{!-- This #block helper will pull data from the hero partial
|
||||||
to inject styles of the hero image to make it responsive --}}
|
to inject styles of the hero image to make it responsive --}}
|
||||||
{{{block "herobackground"}}}
|
{{{block "herobackground"}}}
|
||||||
|
|
||||||
@ -96,6 +96,12 @@
|
|||||||
// @license-end
|
// @license-end
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{{#if @custom.enable_native_search}}
|
||||||
|
<script>
|
||||||
|
const nativeSearchEnabled = true
|
||||||
|
</script>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if @custom.search_api_key}}
|
{{#if @custom.search_api_key}}
|
||||||
<script>
|
<script>
|
||||||
const ghostSearchApiKey = "{{@custom.search_api_key}}"
|
const ghostSearchApiKey = "{{@custom.search_api_key}}"
|
||||||
@ -129,7 +135,9 @@
|
|||||||
{{{body}}}
|
{{{body}}}
|
||||||
|
|
||||||
{{!-- Search form --}}
|
{{!-- Search form --}}
|
||||||
{{> search}}
|
{{^if @custom.enable_native_search}}
|
||||||
|
{{> search}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{!-- The footer --}}
|
{{!-- The footer --}}
|
||||||
{{> footer}}
|
{{> footer}}
|
||||||
|
@ -87,5 +87,5 @@
|
|||||||
"desktop": "assets/screenshot-desktop.jpg",
|
"desktop": "assets/screenshot-desktop.jpg",
|
||||||
"mobile": "assets/screenshot-mobile.jpg"
|
"mobile": "assets/screenshot-mobile.jpg"
|
||||||
},
|
},
|
||||||
"version": "2.1.1"
|
"version": "2.1.2"
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ version: "3"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
ghost:
|
ghost:
|
||||||
image: ghost:5.22.1
|
image: ghost:5.22.10
|
||||||
container_name: ghost
|
container_name: ghost
|
||||||
volumes:
|
volumes:
|
||||||
- ./..:/var/lib/ghost/content/themes/liebling:Z
|
- ./..:/var/lib/ghost/content/themes/liebling:Z
|
||||||
|
@ -66,7 +66,7 @@ $(() => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const trySearchFeature = () => {
|
const trySearchFeature = () => {
|
||||||
if (typeof ghostSearchApiKey !== 'undefined') {
|
if (typeof ghostSearchApiKey !== 'undefined' && typeof nativeSearchEnabled === 'undefined') {
|
||||||
getAllPosts(ghostHost, ghostSearchApiKey);
|
getAllPosts(ghostHost, ghostSearchApiKey);
|
||||||
} else {
|
} else {
|
||||||
$openSearch.css('visibility', 'hidden');
|
$openSearch.css('visibility', 'hidden');
|
||||||
|
Loading…
Reference in New Issue
Block a user