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
|
||||
search_enabled: true
|
||||
socials_in_search: true
|
||||
posts_in_search: true
|
||||
bib_search: true
|
||||
|
||||
# Dimensions
|
||||
|
||||
@ -52,6 +52,7 @@ ninja.data = [
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- if site.posts_in_search -%}
|
||||
{%- for post in site.posts -%}
|
||||
{
|
||||
{%- assign title = post.title | escape | strip -%}
|
||||
@ -76,6 +77,7 @@ ninja.data = [
|
||||
},
|
||||
},
|
||||
{%- endfor -%}
|
||||
{%- endif -%}
|
||||
{%- for collection in site.collections -%}
|
||||
{%- if collection.label != 'posts' -%}
|
||||
{%- for item in collection.docs -%}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user