Add a search result page for hexo-generator-search.
$ npm install hexo-search-result
$ hexo new page search
Open source/search/index.md
and insert a tag like this.
{% search_result %}
By using url parameters, you can use the search result page.
For example:
https://www.example.com/search/?search=foo
This will let the page show the pages matching foo
.
Add a search box for your website by editing your theme.
For example:
<input type="text" id="search-text" />
<button id="search-submit">Search</button>
const text = document.getElementById("search-text")
const submit = document.getElementById("search-submit")
submit.addEventListener("click", () => {
window.location.href = "/search/?search=" + text.value
})
Please fork one!
MIT License