File tree Expand file tree Collapse file tree 1 file changed +7
-27
lines changed
Expand file tree Collapse file tree 1 file changed +7
-27
lines changed Original file line number Diff line number Diff line change 66sitemap: 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 >
You can’t perform that action at this time.
0 commit comments