mirror of
https://github.com/kaka111222333/kaka111222333.github.io.git
synced 2025-12-19 16:25:12 +08:00
add search
This commit is contained in:
19
index.html
19
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 %}
|
||||||
|
|||||||
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