From 7aee05ce0c79c39336f7d8903e9d60c566545ca4 Mon Sep 17 00:00:00 2001 From: LasseAhhMann Date: Mon, 22 Apr 2024 17:22:08 +0200 Subject: [PATCH] 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. --- assets/js/lunr/lunr-store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/lunr/lunr-store.js b/assets/js/lunr/lunr-store.js index 565e3b3e..5e1a6630 100644 --- a/assets/js/lunr/lunr-store.js +++ b/assets/js/lunr/lunr-store.js @@ -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 -%}