mirror of
https://github.com/kaka111222333/kaka111222333.github.io.git
synced 2025-12-19 08:14:52 +08:00
add search
This commit is contained in:
21
index.html
21
index.html
@@ -2,6 +2,25 @@
|
|||||||
layout: default
|
layout: default
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<div id="search-container">
|
||||||
|
<input type="text" id="search-input" placeholder="search...">
|
||||||
|
<ul id="results-container"></ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://unpkg.com/simple-jekyll-search/dest/simple-jekyll-search.min.js"></script>
|
||||||
|
<script>
|
||||||
|
window.simpleJekyllSearch = new SimpleJekyllSearch({
|
||||||
|
searchInput: document.getElementById('search-input'),
|
||||||
|
resultsContainer: document.getElementById('results-container'),
|
||||||
|
json: '{{ site.baseurl }}/search.json',
|
||||||
|
searchResultTemplate: '<li><a href="{url}?query={query}" title="{desc}">{title}</a></li>',
|
||||||
|
noResultsText: 'No results found',
|
||||||
|
limit: 10,
|
||||||
|
fuzzy: false,
|
||||||
|
exclude: ['Welcome']
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
{% if site.posts.size == 0 %}
|
{% if site.posts.size == 0 %}
|
||||||
<h2>No post found</h2>
|
<h2>No post found</h2>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -55,4 +74,4 @@ layout: default
|
|||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
1598
package-lock.json
generated
Normal file
1598
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user