hacks-guide-minimal-mistake.../assets/js/lunr/lunr-store.js
iBug ♦ bcd6126612
Use relative_url and absolute_url where possible (#2387)
* Use relative_url and absolute_url where possible

Drops the `contains "://"` check, adopt Jekyll 3.7
Ref: https://github.com/mmistakes/minimal-mistakes/pull/2385#issuecomment-579882236

* One more unneeded {% assign %}

* Remove one more assign as noted by mmistakes

* Consolidate 4 more captures

* Consolidate an extra assign on "active" class
2020-03-06 15:37:07 -05:00

49 lines
1.7 KiB
JavaScript
Vendored

---
layout: null
---
var store = [
{%- for c in site.collections -%}
{%- if forloop.last -%}
{%- assign l = true -%}
{%- endif -%}
{%- assign docs = c.docs | where_exp:'doc','doc.search != false' -%}
{%- for doc in docs -%}
{%- if doc.header.teaser -%}
{%- capture teaser -%}{{ doc.header.teaser }}{%- endcapture -%}
{%- else -%}
{%- assign teaser = site.teaser -%}
{%- endif -%}
{
"title": {{ doc.title | jsonify }},
"excerpt":
{%- if site.search_full_content == true -%}
{{ doc.content | newline_to_br |
replace:"<br />", " " |
replace:"</p>", " " |
replace:"</h1>", " " |
replace:"</h2>", " " |
replace:"</h3>", " " |
replace:"</h4>", " " |
replace:"</h5>", " " |
replace:"</h6>", " "|
strip_html | strip_newlines | jsonify }},
{%- else -%}
{{ doc.content | newline_to_br |
replace:"<br />", " " |
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 }},
"url": {{ doc.url | absolute_url | jsonify }},
"teaser": {{ teaser | absolute_url | jsonify }}
}{%- unless forloop.last and l -%},{%- endunless -%}
{%- endfor -%}
{%- endfor -%}]