Remove JS and other files from search index (#4000)

To avoid getting JS and irrelevant files indexed remove pages where title is null. This gives a much cleaner Lunr store with more relevant content.
This commit is contained in:
LasseAhhMann 2024-04-22 17:22:08 +02:00 committed by GitHub
parent 08b0303298
commit 7aee05ce0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,7 +47,7 @@ var store = [
}{%- unless forloop.last and l -%},{%- endunless -%}
{%- endfor -%}
{%- endfor -%}{%- if site.lunr.search_within_pages -%},
{%- assign pages = site.pages | where_exp:'doc','doc.search != false' -%}
{%- assign pages = site.pages | where_exp:'doc','doc.search != false and doc.title != null' -%}
{%- for doc in pages -%}
{%- if forloop.last -%}
{%- assign l = true -%}