Re-add ability to exclude posts from search (#3089)
Earlier there was a tag in the `_config.yml` file to exclude the posts from the search results. I could no longer find that option and hence modified the `search.liquid.js` file. It basically checks if the `posts_in_search` tag is true or not.
This commit is contained in:
parent
485e22fdf0
commit
a7b1f8c1b1
@ -52,6 +52,7 @@ navbar_fixed: true
|
|||||||
footer_fixed: true
|
footer_fixed: true
|
||||||
search_enabled: true
|
search_enabled: true
|
||||||
socials_in_search: true
|
socials_in_search: true
|
||||||
|
posts_in_search: true
|
||||||
bib_search: true
|
bib_search: true
|
||||||
|
|
||||||
# Dimensions
|
# Dimensions
|
||||||
|
|||||||
@ -52,6 +52,7 @@ ninja.data = [
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
{%- if site.posts_in_search -%}
|
||||||
{%- for post in site.posts -%}
|
{%- for post in site.posts -%}
|
||||||
{
|
{
|
||||||
{%- assign title = post.title | escape | strip -%}
|
{%- assign title = post.title | escape | strip -%}
|
||||||
@ -76,6 +77,7 @@ ninja.data = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
{%- endif -%}
|
||||||
{%- for collection in site.collections -%}
|
{%- for collection in site.collections -%}
|
||||||
{%- if collection.label != 'posts' -%}
|
{%- if collection.label != 'posts' -%}
|
||||||
{%- for item in collection.docs -%}
|
{%- for item in collection.docs -%}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user