From c0763fff61c160da95e361fd6724e886aff3226f Mon Sep 17 00:00:00 2001 From: George <31376482+george-gca@users.noreply.github.com> Date: Mon, 27 May 2024 13:50:14 -0300 Subject: [PATCH] Fixed news titles in search (#2450) Signed-off-by: George Araujo --- _includes/scripts/search.liquid | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/_includes/scripts/search.liquid b/_includes/scripts/search.liquid index b023cd2..63d2dd4 100644 --- a/_includes/scripts/search.liquid +++ b/_includes/scripts/search.liquid @@ -84,20 +84,26 @@ }, }, {%- endfor -%} - {% for collection in site.collections %} + {%- for collection in site.collections -%} {%- for item in collection.docs -%} { - {%- assign title = item.title | escape -%} + {%- if item.inline -%} + {%- assign title = item.content | remove: '

' | remove: '

' | escape | strip -%} + {%- else -%} + {%- assign title = item.title | escape -%} + {%- endif -%} id: "{{ collection.label }}-{{ title | slugify }}", - title: "{{ title }}", + title: '{{ title | emojify }}', description: "{{ item.description | strip_html | strip_newlines | escape }}", section: "{{ collection.label | capitalize }}", - handler: () => { - window.location.href = "{{ item.url | relative_url }}"; - }, + {%- unless item.inline -%} + handler: () => { + window.location.href = "{{ item.url | relative_url }}"; + }, + {%- endunless -%} }, {%- endfor -%} - {% endfor %} + {%- endfor -%} {%- if site.socials_in_search -%} {%- if site.email -%} {