Filter posts by variable to use search function

Also try hardcode your value to see if you can get English on any page and ignore the local page lang.

## Debugging my lang 
{%- assign _doc = _collection1.docs | where: 'lang', 'en' -%}

{{ _doc size }}

{{ _doc | inspect }}

Note i did that outside the JS.

If you still get br results or you get zero results, then something could be wrong with the language on each page

If you get that filtering to work, then proceed to the longer JS logic

1 Like