Hexo-theme-next: 5.1.2版本的本地搜索不可用,请问在不升级6.X的情况下如何处理

Created on 17 Sep 2019  ·  14Comments  ·  Source: theme-next/hexo-theme-next


Expected behavior

点击搜索调起本地搜索弹框

Actual behavior

点击后,一直loading

Hexo Information

Hexo version

3.8.0

Hexo Configuration


NexT Information

NexT Version:

  • [ ] Latest Master branch
  • [ ] Latest Release version
  • [x] Old version

NexT Scheme:

  • [ ] All schemes
  • [ ] Muse
  • [x] Mist
  • [ ] Pisces
  • [ ] Gemini

NexT Configuration:


# Local Search
# Dependencies: https://github.com/wzpan/hexo-generator-search
local_search:
  enable: true
  # If auto, trigger search by changing input.
  # If manual, trigger search by pressing enter key or search button.
  trigger: auto
  # Show top n results per article, show all results by setting to -1
  top_n_per_article: 1
  # Unescape html strings to the readable one.
  unescape: false
  # Preload the search data when the page loads.
  preload: false

Other Information

由于本人在原版本(5.x)更改了custom.styl,通过类名做了很多的自定义css,但是在升级6.x后,(按照官方文档做了迁移),发现较多的类名发生更改,一些配置改变。所以本人目前只是想修复本地搜索加载不出来的问题,而不想升级版本。故想知道在不升级6.X的情况下如何处理“本地搜索加载不出来”的问题。

Question Solved

Most helpful comment

https://wdd.js.org/vscode-control-characters-problem.html
主要原因是这个,把那些字符删掉就行了

洞香春
1. 环境 macOS Sierra 10.12.5 vscode 1.20.0 最新版 2. 如何重现这个问题在使用中文输入法输入中文的时候,一直按后退键,例如输入sfsf,当你按了4下后退键时,你会发现,搜狗输入法弹出框虽然消失了,但是页面上还会剩下一个s, 这是你如何再次按一下后退的话,s就会变成bs, 变成隐藏字符。这个一般是右边有markdown渲染插件时才会出现。 从更确切的角度说

All 14 comments

Thanks for opening this issue, maintainers will get back to you as soon as possible!

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

你能提供下你博客的源码或者博客的地址么

@jiangtj https://blog.simmzl.cn/

CQ STUDIO
A Studio About Shiba Inu.

未发现问题Orz,检查下以下的文件是否与你的文件一致,理论上5.1.2的搜索也是可用的

https://github.com/iissnan/hexo-theme-next/blob/v5.1.2/layout/_partials/header.swig#L52-L65
https://github.com/iissnan/hexo-theme-next/blob/v5.1.2/layout/_third-party/search/index.swig#L2
https://github.com/iissnan/hexo-theme-next/blob/v5.1.2/layout/_third-party/search/localsearch.swig
https://github.com/iissnan/hexo-theme-next/blob/v5.1.2/layout/_partials/search.swig#L7-L9
https://github.com/iissnan/hexo-theme-next/blob/v5.1.2/layout/_partials/search/localsearch.swig

GitHub
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.
GitHub
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.
GitHub
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.
GitHub
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.
GitHub
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.

@jiangtj 文件是一样的。

而且我又试了一次从搭建hexo以及使用clone iissnan/hexo-theme-next 5.1.2版本的主题,一切配置好了之后,搜索同之前描述的情况一样,一直loading。

搜索到相同的问题issue:https://github.com/iissnan/hexo-theme-next/issues/2122

Clean project with next 5.1.2, seems work fine.

Do you install hexo-generator-search?

image

删除search插件重新安装一下,
npm uninstall hexo-generator-search --save or npm uninstall hexo-generator-searchdb --save
然后重新安装一下插件,
https://github.com/wzpan/hexo-generator-search

GitHub
A plugin to generate search data for Hexo. Contribute to wzpan/hexo-generator-search development by creating an account on GitHub.

因为jQuery没有抛出错误,所以很难定位到问题

这应该是 hexo-generator-search 老版本的 bug, 升级到最新版试试

这应该是 hexo-generator-search 老版本的 bug, 升级到最新版试试

按理说,就算有bug,他都不升级也不会有问题的啊,搞不懂

因为jQuery没有抛出错误,所以很难定位到问题

是的,大致看上去没问题。。。。。。

https://wdd.js.org/vscode-control-characters-problem.html
主要原因是这个,把那些字符删掉就行了

洞香春
1. 环境 macOS Sierra 10.12.5 vscode 1.20.0 最新版 2. 如何重现这个问题在使用中文输入法输入中文的时候,一直按后退键,例如输入sfsf,当你按了4下后退键时,你会发现,搜狗输入法弹出框虽然消失了,但是页面上还会剩下一个s, 这是你如何再次按一下后退的话,s就会变成bs, 变成隐藏字符。这个一般是右边有markdown渲染插件时才会出现。 从更确切的角度说

@Raincal @jiangtj @stevenjoezhang @yeahwu 问题解决了,
使用 @Raincal 提供的方法:https://wdd.js.org/vscode-control-characters-problem.html
多谢各位!

Was this page helpful?
0 / 5 - 0 ratings