Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed news titles in search #2450

Merged
merged 1 commit into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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