2019-12-31 18:17:27 +03:00
|
|
|
<!--
|
|
|
|
Jekyll Simple Search loader
|
2021-02-04 18:08:09 +03:00
|
|
|
See: <https://github.com/christian-fei/Simple-Jekyll-Search>
|
2019-12-31 18:17:27 +03:00
|
|
|
-->
|
|
|
|
|
|
|
|
{% capture result_elem %}
|
2023-04-10 05:54:27 +03:00
|
|
|
<div class="px-1 px-sm-2 px-lg-4 px-xl-0">
|
2021-10-11 19:13:26 +03:00
|
|
|
<a href="{url}">{title}</a>
|
2019-12-31 18:17:27 +03:00
|
|
|
<div class="post-meta d-flex flex-column flex-sm-row text-muted mt-1 mb-1">
|
2021-02-04 18:08:09 +03:00
|
|
|
{categories}
|
|
|
|
{tags}
|
2019-12-31 18:17:27 +03:00
|
|
|
</div>
|
|
|
|
<p>{snippet}</p>
|
|
|
|
</div>
|
|
|
|
{% endcapture %}
|
|
|
|
|
2023-05-06 02:22:29 +03:00
|
|
|
{% capture not_found %}<p class="mt-5">{{ site.data.locales[include.lang].search.no_results }}</p>{% endcapture %}
|
2019-12-31 19:18:21 +03:00
|
|
|
|
2022-06-02 15:55:34 +03:00
|
|
|
<script src="{{ site.data.assets[origin].search.js | relative_url }}"></script>
|
2020-05-29 19:48:10 +03:00
|
|
|
|
2019-12-31 18:17:27 +03:00
|
|
|
<script>
|
2023-04-10 05:54:27 +03:00
|
|
|
|
2019-12-31 18:17:27 +03:00
|
|
|
SimpleJekyllSearch({
|
|
|
|
searchInput: document.getElementById('search-input'),
|
|
|
|
resultsContainer: document.getElementById('search-results'),
|
2021-01-18 18:27:43 +03:00
|
|
|
json: '{{ '/assets/js/data/search.json' | relative_url }}',
|
2020-01-08 20:45:01 +03:00
|
|
|
searchResultTemplate: '{{ result_elem | strip_newlines }}',
|
2021-02-04 18:08:09 +03:00
|
|
|
noResultsText: '{{ not_found }}',
|
|
|
|
templateMiddleware: function(prop, value, template) {
|
|
|
|
if (prop === 'categories') {
|
|
|
|
if (value === '') {
|
|
|
|
return `${value}`;
|
|
|
|
} else {
|
2023-04-10 05:54:27 +03:00
|
|
|
return `<div class="me-sm-4"><i class="far fa-folder fa-fw"></i>${value}</div>`;
|
2021-02-04 18:08:09 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (prop === 'tags') {
|
|
|
|
if (value === '') {
|
|
|
|
return `${value}`;
|
|
|
|
} else {
|
|
|
|
return `<div><i class="fa fa-tag fa-fw"></i>${value}</div>`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-31 18:17:27 +03:00
|
|
|
});
|
2023-04-10 05:54:27 +03:00
|
|
|
|
2021-01-18 18:27:43 +03:00
|
|
|
</script>
|