add optinal lunr searching of pages (#3352)
This commit is contained in:
36
assets/js/lunr/lunr-store.js
vendored
36
assets/js/lunr/lunr-store.js
vendored
@@ -46,4 +46,38 @@ var store = [
|
||||
"teaser": {{ teaser | relative_url | jsonify }}
|
||||
}{%- unless forloop.last and l -%},{%- endunless -%}
|
||||
{%- endfor -%}
|
||||
{%- endfor -%}]
|
||||
{%- endfor -%}{%- if site.lunr.search_within_pages -%},
|
||||
{%- for doc in site.pages -%}
|
||||
{%- if forloop.last -%}
|
||||
{%- assign l = true -%}
|
||||
{%- 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 -%}
|
||||
"url": {{ doc.url | absolute_url | jsonify }}
|
||||
}{%- unless forloop.last and l -%},{%- endunless -%}
|
||||
{%- endfor -%}
|
||||
{%- endif -%}]
|
||||
|
Reference in New Issue
Block a user