From 24d730578ac9fca1d28198c360b59b0fe252218b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:41:26 -0800 Subject: [PATCH] Refactor: Use Liquid filter to find home page title (#3448) Refactored the script in _scripts/search.liquid.js to use a more efficient Liquid 'where' filter to find the home page title. This replaces an inefficient for loop that iterated through all site pages. --- *PR created automatically by Jules for task [5748098109809984605](https://jules.google.com/task/5748098109809984605) started by @alshedivat* Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- _scripts/search.liquid.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/_scripts/search.liquid.js b/_scripts/search.liquid.js index e43540c..946a589 100644 --- a/_scripts/search.liquid.js +++ b/_scripts/search.liquid.js @@ -6,9 +6,7 @@ const ninja = document.querySelector('ninja-keys'); // add the home and posts menu items ninja.data = [ - {%- for page in site.pages -%} - {%- if page.permalink == '/' -%}{%- assign about_title = page.title | strip -%}{%- endif -%} - {%- endfor -%} + {%- assign about_title = site.pages | where: "permalink", "/" | first.title | strip -%} { id: "nav-{{ about_title | slugify }}", title: "{{ about_title | truncatewords: 13 }}",