probberechts / hexo-theme-cactus

:cactus: A responsive, clean and simple theme for Hexo.
https://probberechts.github.io/hexo-theme-cactus/
MIT License
3.15k stars 783 forks source link

About Search (wrong URL) #247

Closed ColderCoder closed 2 years ago

ColderCoder commented 3 years ago

I'm using hexo: 5.2.0 with hexo-generator-search@2.4.1.
The search page works fine and I can see results as I type.
But the search function will auto append search/ after the root path.
(e.g.) It should be localhost:4000/post/something/ while it returns localhost:4000/search/post/something/

probberechts commented 3 years ago

This is a bug in hexo-generator-search. See https://github.com/wzpan/hexo-generator-search/issues/66.

sirlh commented 3 years ago

A solution

ATommyGirl commented 3 years ago

I replace the search.js by this Ocean-search.js. It worked.

ColderCoder commented 3 years ago

A solution

Than you! It does work for me. @probberechts Maybe we should apply this simple fix?

probberechts commented 3 years ago

@sirlh's solution only works if your website is hosted at the root (see also #287). While this fixes the problem for some people, it would break the search functionality for others. This really has to be fixed in hexo-generator-search.

probberechts commented 2 years ago

This is fixed in hexo-generator-search@2.4.3 :tada: