hexo部落格本地搜尋失效,一直轉圈
阿新 • • 發佈:2020-12-25
關於 Hexo 的 Local Search 失效的問題
問題描述:
你會發現一開始你的Blog搜尋功能還是正常的,搜尋出結果一直在轉圈圈等待,或者 搜尋功能能搜尋但是不能跳轉過去,隨著添加了幾篇文章以後,搜尋就不正常了,訪問你的部落格 http://你的部落格域名/search.xml
的時候,提示有存在不可解析的位元組的錯誤,大致如下:
This page contains the following errors:error on line 66 at column 35: Input is not proper UTF-8, indicate encoding !Bytes: 0x08 0xE8 0xAF 0x84Below is a rendering of the page up to the first error.
此時,是因為你的xml解析有問題,換成json來解析即可,編輯你的站點配置檔案 _config.yml
找到搜尋的地方 把 Search的xml解析改成json解析,具體改完後 如下:
search: path: search.json field: post format: html limit: 10000
完美解決搜尋問題。