mirror of
https://github.com/kaka111222333/kaka111222333.github.io.git
synced 2025-12-19 00:04:46 +08:00
add search
This commit is contained in:
21
index.html
21
index.html
@@ -2,6 +2,25 @@
|
||||
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 %}
|
||||
<h2>No post found</h2>
|
||||
{% endif %}
|
||||
@@ -55,4 +74,4 @@ layout: default
|
||||
</a>
|
||||
</span>
|
||||
{% 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