Add a search result page for hexo-generator-search.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
client.js
index.js
package.json
readme.md
style.css

readme.md

hexo-search-result

Add a search result page for hexo-generator-search.

Install

$ npm install hexo-search-result

Usage

Add a new page

$ hexo new page search

Write a tag

Open source/search/index.md and insert a tag like this.

{% search_result %}

Access to the page

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

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
})

Customize

Please fork one!

License

MIT License