Skip to content

Commit

Permalink
Fixed news titles in search (alshedivat#2450)
Browse files Browse the repository at this point in the history
Signed-off-by: George Araujo <george.gcac@gmail.com>
  • Loading branch information
george-gca authored May 27, 2024
1 parent 9003009 commit d4bd09c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions _includes/scripts/search.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<p>' | remove: '</p>' | 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 -%}
{
Expand Down

0 comments on commit d4bd09c

Please # to comment.