From 03a26a105d98b9059757f7ab4fc4eecb7c5e430d Mon Sep 17 00:00:00 2001 From: FavorMylikes Date: Sat, 28 May 2022 00:22:43 +0800 Subject: [PATCH] Update algolia-search-scripts.html (#3102) Fix issue https://github.com/mmistakes/minimal-mistakes/issues/3101 --- _includes/search/algolia-search-scripts.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_includes/search/algolia-search-scripts.html b/_includes/search/algolia-search-scripts.html index 2728d290..ba557c14 100644 --- a/_includes/search/algolia-search-scripts.html +++ b/_includes/search/algolia-search-scripts.html @@ -19,8 +19,9 @@ const search = instantsearch({ const hitTemplate = function(hit) { const url = hit.url; - const title = hit._highlightResult.title.value; - const content = hit._highlightResult.html.value; + const hightlight = hit._highlightResult; + const title = hightlight.title && hightlight.title.value || ""; + const content = hightlight.html && hightlight.html.value || ""; return `