Skip to content

shundroid/hexo-search-result

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published