Skip to content

Commit 0542443

Browse files
Update search.html
1 parent f5112e4 commit 0542443

File tree

1 file changed

+7
-27
lines changed

1 file changed

+7
-27
lines changed

search.html

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,15 @@
66
sitemap: false
77
---
88
<ul id="results"></ul>
9-
<script src="https://unpkg.com/simple-jekyll-search@latest/dest/simple-jekyll-search.min.js"></script>
109
<script>
11-
var sjs = SimpleJekyllSearch({
12-
searchInput: null,
13-
resultsContainer: document.getElementById('results'),
14-
json: '/search.json',
15-
searchResultTemplate: `
16-
<li class="article-list-item {% if site.scrollappear_enabled %}scrollappear{% endif %}">
17-
<a href="{{ page.url | relative_url }}" title="{{ page.title }}">
18-
<h5>
19-
{{ page.title }}
20-
{% include svg-icon.html icon="arrow-right" %}
21-
</h5>
22-
</a>
23-
<p>
24-
{% if page.description %}
25-
{{ post.description }}
26-
{% else %}
27-
{{ page.excerpt }}
28-
{% endif %}
29-
</p>
30-
{% include article/info-footer.html post=page %}
31-
</li>
32-
`
33-
});
3410
// Получаем текущий URL
3511
const urlParams = new URLSearchParams(window.location.search);
36-
3712
// Получаем конкретные значения
38-
const query = urlParams.get('query'); // "Ivan"
39-
sjs.search(query);
13+
const query = urlParams.get('query');
14+
const posts = await fetch("/search.json");
15+
for post in posts {
16+
if post["title"].prototype.includes(query) {
17+
18+
}
19+
}
4020
</script>

0 commit comments

Comments
 (0)