~xdavidwu/xdavidwu.link

28c33e98010d85f8a25e3d9101dfa38bbbf472d0 — Michael Rose 6 years ago 8481dd4
Fix search excerpts that run together
2 files changed, 19 insertions(+), 2 deletions(-)

M CHANGELOG.md
M assets/js/lunr/lunr-store.js
M CHANGELOG.md => CHANGELOG.md +1 -0
@@ 7,6 7,7 @@
### Bug Fixes

* Replace `absolute_url` filter with `relative_url` where it makes sense (asset/nagivation related paths). [#1588](https://github.com/mmistakes/minimal-mistakes/issues/1588)
* Fix search excerpts that run together because of implied spaces.

## [4.10.1](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.10.1)


M assets/js/lunr/lunr-store.js => assets/js/lunr/lunr-store.js +18 -2
@@ 18,9 18,25 @@ var store = [
        "title": {{ doc.title | jsonify }},
        "excerpt":
          {%- if site.search_full_content == true -%}
            {{ doc.content | strip_html | strip_newlines | jsonify }},
            {{ doc.content |
              replace:"</p>", " " |
              replace:"</h1>", " " |
              replace:"</h2>", " " |
              replace:"</h3>", " " |
              replace:"</h4>", " " |
              replace:"</h5>", " " |
              replace:"</h6>", " "|
            strip_html | strip_newlines | jsonify }},
          {%- else -%}
            {{ doc.content | strip_html | strip_newlines | truncatewords: 50 | jsonify }},
            {{ doc.content |
              replace:"</p>", " " |
              replace:"</h1>", " " |
              replace:"</h2>", " " |
              replace:"</h3>", " " |
              replace:"</h4>", " " |
              replace:"</h5>", " " |
              replace:"</h6>", " "|
            strip_html | strip_newlines | truncatewords: 50 | jsonify }},
          {%- endif -%}
        "categories": {{ doc.categories | jsonify }},
        "tags": {{ doc.tags | jsonify }},