Skip to content

Commit 1670f4b

Browse files
authored
Fix documentation search localisation (#167)
1 parent 16de95a commit 1670f4b

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: null
3+
---
4+
[
5+
{% for documentation in site.documentation %}
6+
{% capture title %}{% t {{ documentation.title }} %}{% endcapture %}
7+
{
8+
"title" : "{{ title | escape }}",
9+
"url" : "{% if site.lang != "en" %}/{{ site.lang }}{% endif %}{{ documentation.url | replace:'.html','' }}",
10+
"content" : {{ documentation.content | strip_html | strip_newlines | jsonify }}
11+
} {% unless forloop.last %},{% endunless %}
12+
{% endfor %}
13+
]
14+

documentation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h1 class="color-gray-800 weight-700">{% t titles.documentation %}</h1>
4141
searchResultTemplate: '<li><a href="{url}">{title}</a></li>',
4242
limit: 5,
4343
fuzzy: false,
44-
json: '/search.json'
44+
json: '{% if site.lang != "en" %}/{{ site.lang }}{% endif %}/assets/search-indexes/documentation_search.json'
4545
})
4646
});
4747
</script>

search.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)