search bug fix
This commit is contained in:
parent
5acd0525b6
commit
ed920bdd6d
|
@ -7,7 +7,7 @@
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<title>{{ block "title" . }}{{ .Title }} – {{ .Site.Title }}{{ end }}</title>
|
<title>{{ block "title" . }}{{ .Title }} – {{ .Site.Title }}{{ end }}</title>
|
||||||
{{ partial "head/scripts" . }}
|
{{ partial "head/scripts" . }}
|
||||||
{{ partialCached "head/styles" . }}
|
{{ partial "head/styles" . }}
|
||||||
{{ partial "head/meta" . }}
|
{{ partial "head/meta" . }}
|
||||||
{{ partial "head/meta_json_ld" . }}
|
{{ partial "head/meta_json_ld" . }}
|
||||||
{{ partial "head/services" . }}
|
{{ partial "head/services" . }}
|
||||||
|
|
|
@ -620,16 +620,16 @@
|
||||||
li.className = 'search-result__item';
|
li.className = 'search-result__item';
|
||||||
|
|
||||||
var a = document.createElement('a');
|
var a = document.createElement('a');
|
||||||
a.innerHTML = obj.title;
|
a.innerHTML = obj.item.title;
|
||||||
a.setAttribute('class', 'search-result__item--title');
|
a.setAttribute('class', 'search-result__item--title');
|
||||||
a.setAttribute('href', obj.permalink);
|
a.setAttribute('href', obj.item.permalink);
|
||||||
|
|
||||||
var descDiv = document.createElement('div');
|
var descDiv = document.createElement('div');
|
||||||
descDiv.setAttribute('class', 'search-result__item--desc');
|
descDiv.setAttribute('class', 'search-result__item--desc');
|
||||||
if (obj.description) {
|
if (obj.item.description) {
|
||||||
descDiv.innerHTML = obj.description;
|
descDiv.innerHTML = obj.item.description;
|
||||||
} else if (obj.content) {
|
} else if (obj.item.content) {
|
||||||
descDiv.innerHTML = obj.content.substring(0, 225);
|
descDiv.innerHTML = obj.item.content.substring(0, 225);
|
||||||
}
|
}
|
||||||
|
|
||||||
li.appendChild(a);
|
li.appendChild(a);
|
||||||
|
|
Loading…
Reference in New Issue