mirror of
https://github.com/thangisme/notes.git
synced 2024-09-01 18:34:15 -04:00
Because `page.title` (and `page.url`) is already escaped and page titles served by lunrjs do not need escaping, ampersands need to be unescaped to display properly in search results.
13 lines
530 B
JSON
13 lines
530 B
JSON
---
|
|
---
|
|
{
|
|
{% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": {
|
|
"id": "{{ forloop.index0 }}",
|
|
"title": "{{ page.title | replace: '&', '&' }}",
|
|
"content": "{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | normalize_whitespace }}",
|
|
"url": "{{ page.url | absolute_url }}",
|
|
"relUrl": "{{ page.url }}"
|
|
}{% unless forloop.last %},{% endunless %}
|
|
{% endif %}{% endfor %}
|
|
}
|