tufu9441 / maupassant-hexo

A simple Hexo theme forked from icylogic.
https://www.haomwei.com
MIT License
2.61k stars 670 forks source link

使用self_search时搜出来的结果链接错误 #508

Closed yqi96 closed 2 years ago

yqi96 commented 3 years ago

链接中的部分内容有时候会出现两遍,如 posts/b956e9d5.html --> posts/posts/b956e9d5.html

yqi96 commented 3 years ago

在主页搜是正常的,在某篇博客正文搜会出现url重复

yqi96 commented 3 years ago

搜出来的结果应该是没错的,不管在主页搜还是博客正文搜都是posts/xxxx.html,但是在主页能正确跳转,博客正文跳转的时候就会多出一个posts。我用了hexo-abbrlink,所以链接是“posts/xxxx.html”形式,如果不用的话重复的就是一堆日期。 我不懂前端,暂时只能hardcode将就一下,在search.js第53行强行补全链接:

str += "<li><a href='"+ "http://localhost:4000/" + data_url +"' class='search-result-title'>"+ data_title +"</a>"