Skip to content

Commit

Permalink
Ignore posts from collection
Browse files Browse the repository at this point in the history
  • Loading branch information
sylhare committed Dec 18, 2023
1 parent 2c6f6cc commit 5d4d337
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions _includes/default/search_input.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@
{% endunless %}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
{% if site.collections.size > 0 %},{% endif %}
{% if site.collections.size > 1 %},{% endif %}
{% for collection in site.collections %}
{% for page in site[collection.label] %}
{
{% if page.excluded or page.title != nil %}
"title" : "{{ page.title | strip_newlines | escape }}",
"category" : "{{ page.category }}",
"tags" : "{{ page.tags | join: ', ' | prepend: " " }}",
"url" : "{{ page.url | relative_url }}",
"date" : "{{ page.date | date: "%B %-d, %Y" | default: "N/A" }}",
"excerpt" : {{ page.content | strip_html | strip_newlines | strip | escape | truncate: '250' | jsonify }},
"content" : {{ page.content | strip_html | strip_newlines | strip | escape | jsonify }}
{% endif %}
}{% unless forloop.last %},{% endunless %}
{% unless collection.label == 'posts' %}
{
{% if page.excluded or page.title != nil %}
"title" : "{{ page.title | strip_newlines | escape }}",
"category" : "{{ page.category }}",
"tags" : "{{ page.tags | join: ', ' | prepend: " " }}",
"url" : "{{ page.url | relative_url }}",
"date" : "{{ page.date | date: "%B %-d, %Y" | default: "N/A" }}",
"excerpt" : {{ page.content | strip_html | strip_newlines | strip | escape | truncate: '250' | jsonify }},
"content" : {{ page.content | strip_html | strip_newlines | strip | escape | jsonify }}
{% endif %}
}{% unless forloop.last %},{% endunless %}
{% endunless %}
{% endfor %}
{% unless forloop.last %},{% endunless %}
{% endfor %}
Expand Down

0 comments on commit 5d4d337

Please sign in to comment.