Skip to content

Commit

Permalink
Exclude main.scss from Lunr search index
Browse files Browse the repository at this point in the history
  • Loading branch information
mmistakes committed May 27, 2022
1 parent bcb15f8 commit 55f6e8f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

### Enhancements

- Exclude `main.scss` from Lunr search index.
- Allow `site.pages` to be indexed and searched via Lunr. [#3352](https://github.com/mmistakes/minimal-mistakes/pull/3352)
- Update jQuery to v3.6.0. [#3254](https://github.com/mmistakes/minimal-mistakes/pull/3254)
- Use notice `<a>` colors for blockquotes that have `notice--` classes applied. [#3140](https://github.com/mmistakes/minimal-mistakes/pull/3140) [#3068](https://github.com/mmistakes/minimal-mistakes/issues/3068)
Expand Down
1 change: 1 addition & 0 deletions assets/css/main.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
# Only the main Sass file needs front matter (the dashes are enough)
search: false
---

@charset "utf-8";
Expand Down
3 changes: 2 additions & 1 deletion assets/js/lunr/lunr-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ var store = [
}{%- unless forloop.last and l -%},{%- endunless -%}
{%- endfor -%}
{%- endfor -%}{%- if site.lunr.search_within_pages -%},
{%- for doc in site.pages -%}
{%- assign pages = site.pages | where_exp:'doc','doc.search != false' -%}
{%- for doc in pages -%}
{%- if forloop.last -%}
{%- assign l = true -%}
{%- endif -%}
Expand Down
1 change: 1 addition & 0 deletions docs/_docs/18-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ toc: false

### Enhancements

- Exclude `main.scss` from Lunr search index.
- Allow `site.pages` to be indexed and searched via Lunr. [#3352](https://github.com/mmistakes/minimal-mistakes/pull/3352)
- Update jQuery to v3.6.0. [#3254](https://github.com/mmistakes/minimal-mistakes/pull/3254)
- Use notice `<a>` colors for blockquotes that have `notice--` classes applied. [#3140](https://github.com/mmistakes/minimal-mistakes/pull/3140) [#3068](https://github.com/mmistakes/minimal-mistakes/issues/3068)
Expand Down
2 changes: 2 additions & 0 deletions test/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ atom_feed:
search : true # true, false (default)
search_full_content : true # true, false (default)
search_provider : "lunr"
lunr:
search_within_pages : true
algolia:
application_id : "QB6HVGBSBA"
index_name : "dev_minimal-mistakes"
Expand Down

0 comments on commit 55f6e8f

Please sign in to comment.