mirror of
https://github.com/snachodog/just-the-docs.git
synced 2026-06-04 04:47:14 -06:00
Use unless loop for comma
and mention `search_exclude`
This commit is contained in:
@@ -7,6 +7,6 @@
|
|||||||
"content": "{{ page.content | newline_to_br | replace: '<br />', ' ' | replace: '</h1>', ' ' | strip_newlines | markdownify | strip_html | remove: 'Table of contents' | xml_excape | escape | replace: '\', ' ' | replace: '```', '' | replace: ' ', ' ' | replace: ' ', ' ' | remove: '---' | remove: '#####' | remove: '####' | remove: '###' | remove: '##' | strip_newlines }}",
|
"content": "{{ page.content | newline_to_br | replace: '<br />', ' ' | replace: '</h1>', ' ' | strip_newlines | markdownify | strip_html | remove: 'Table of contents' | xml_excape | escape | replace: '\', ' ' | replace: '```', '' | replace: ' ', ' ' | replace: ' ', ' ' | remove: '---' | remove: '#####' | remove: '####' | remove: '###' | remove: '##' | strip_newlines }}",
|
||||||
"url": "{{ page.url | absolute_url | xml_escape }}",
|
"url": "{{ page.url | absolute_url | xml_escape }}",
|
||||||
"relUrl": "{{ page.url | xml_escape }}"
|
"relUrl": "{{ page.url | xml_escape }}"
|
||||||
}{% if forloop.last %}{% else %},{% endif %}
|
}{% unless forloop.last %},{% endunless %}
|
||||||
{% endif %}{% endfor %}
|
{% endif %}{% endfor %}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -37,13 +37,13 @@ This command creates the `search-data.json` file that Jekyll uses to create your
|
|||||||
{% raw %}---
|
{% raw %}---
|
||||||
---
|
---
|
||||||
{
|
{
|
||||||
{% for page in site.html_pages %}"{{ forloop.index0 }}": {
|
{% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": {
|
||||||
"id": "{{ forloop.index0 }}",
|
"id": "{{ forloop.index0 }}",
|
||||||
"title": "{{ page.title | xml_escape }}",
|
"title": "{{ page.title | xml_escape }}",
|
||||||
"content": "{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | remove: page.title | strip_newlines | replace: '\', ' '}}",
|
"content": "{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | remove: page.title | strip_newlines | replace: '\', ' '}}",
|
||||||
"url": "{{ page.url | absolute_url | xml_escape }}",
|
"url": "{{ page.url | absolute_url | xml_escape }}",
|
||||||
"relUrl": "{{ page.url | xml_escape }}"
|
"relUrl": "{{ page.url | xml_escape }}"
|
||||||
}{% if forloop.last %}{% else %},
|
}{% unless forloop.last %},{% endunless %}
|
||||||
{% endif %}{% endfor %}
|
{% endif %}{% endfor %}
|
||||||
}{% endraw %}
|
}{% endraw %}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ namespace :search do
|
|||||||
f.puts '---
|
f.puts '---
|
||||||
---
|
---
|
||||||
{
|
{
|
||||||
{% for page in site.html_pages %}"{{ forloop.index0 }}": {
|
{% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": {
|
||||||
"id": "{{ forloop.index0 }}",
|
"id": "{{ forloop.index0 }}",
|
||||||
"title": "{{ page.title | xml_escape }}",
|
"title": "{{ page.title | xml_escape }}",
|
||||||
"content": "'+content+'",
|
"content": "'+content+'",
|
||||||
"url": "{{ page.url | absolute_url | xml_escape }}",
|
"url": "{{ page.url | absolute_url | xml_escape }}",
|
||||||
"relUrl": "{{ page.url | xml_escape }}"
|
"relUrl": "{{ page.url | xml_escape }}"
|
||||||
}{% if forloop.last %}{% else %},
|
}{% unless forloop.last %},{% endunless %}
|
||||||
{% endif %}{% endfor %}
|
{% endif %}{% endfor %}
|
||||||
}'
|
}'
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user