From 7ea8510d4f554e670bfd2c3c30ed3a2fc3a39323 Mon Sep 17 00:00:00 2001 From: iBug Date: Sun, 28 Apr 2024 00:56:17 +0800 Subject: [PATCH] Fix where_exp for Jekyll < 4.0 'and' and 'or' are new in Jekyll 4.0. Ref: https://stackoverflow.com/posts/comments/111965719 --- CHANGELOG.md | 1 + assets/js/lunr/lunr-store.js | 2 +- docs/_docs/18-history.md | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b52f7ba91f0..5f7e170a6d3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - "You may also enjoy" no longer recommends hidden posts. [#4653](https://github.com/mmistakes/minimal-mistakes/issues/4653) - Replaced dead link to "Viewport and Media Queries" slides. [#4421](https://github.com/mmistakes/minimal-mistakes/discussions/4421) +- Fix broken `where_exp` in `lunr-store.js` for Jekyll < 4.0. [#4808](https://github.com/mmistakes/minimal-mistakes/issues/4808) ### Enhancements diff --git a/assets/js/lunr/lunr-store.js b/assets/js/lunr/lunr-store.js index 5e1a66306e94..fe14f7e11b4e 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 and doc.title != null' -%} + {%- assign pages = site.pages | where_exp: 'doc', 'doc.search != false' | where_exp: 'doc', 'doc.title != null' -%} {%- for doc in pages -%} {%- if forloop.last -%} {%- assign l = true -%} diff --git a/docs/_docs/18-history.md b/docs/_docs/18-history.md index 6f7fd2a5663e..47eff96e718d 100644 --- a/docs/_docs/18-history.md +++ b/docs/_docs/18-history.md @@ -5,7 +5,7 @@ permalink: "/docs/history/" excerpt: Change log of enhancements and bug fixes made to the theme. sidebar: nav: docs -last_modified_at: '2024-04-28T00:38:38+08:00' +last_modified_at: '2024-04-28T00:56:01+08:00' toc: false --- @@ -21,6 +21,7 @@ toc: false - "You may also enjoy" no longer recommends hidden posts. [#4653](https://github.com/mmistakes/minimal-mistakes/issues/4653) - Replaced dead link to "Viewport and Media Queries" slides. [#4421](https://github.com/mmistakes/minimal-mistakes/discussions/4421) +- Fix broken `where_exp` in `lunr-store.js` for Jekyll < 4.0. [#4808](https://github.com/mmistakes/minimal-mistakes/issues/4808) ### Enhancements