Skip to content

Commit c0763ff

Browse files
authored
Fixed news titles in search (#2450)
Signed-off-by: George Araujo <[email protected]>
1 parent da44865 commit c0763ff

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

_includes/scripts/search.liquid

+13-7
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,26 @@
8484
},
8585
},
8686
{%- endfor -%}
87-
{% for collection in site.collections %}
87+
{%- for collection in site.collections -%}
8888
{%- for item in collection.docs -%}
8989
{
90-
{%- assign title = item.title | escape -%}
90+
{%- if item.inline -%}
91+
{%- assign title = item.content | remove: '<p>' | remove: '</p>' | escape | strip -%}
92+
{%- else -%}
93+
{%- assign title = item.title | escape -%}
94+
{%- endif -%}
9195
id: "{{ collection.label }}-{{ title | slugify }}",
92-
title: "{{ title }}",
96+
title: '{{ title | emojify }}',
9397
description: "{{ item.description | strip_html | strip_newlines | escape }}",
9498
section: "{{ collection.label | capitalize }}",
95-
handler: () => {
96-
window.location.href = "{{ item.url | relative_url }}";
97-
},
99+
{%- unless item.inline -%}
100+
handler: () => {
101+
window.location.href = "{{ item.url | relative_url }}";
102+
},
103+
{%- endunless -%}
98104
},
99105
{%- endfor -%}
100-
{% endfor %}
106+
{%- endfor -%}
101107
{%- if site.socials_in_search -%}
102108
{%- if site.email -%}
103109
{

0 commit comments

Comments
 (0)