theme-next / hexo-theme-next

Elegant and powerful theme for Hexo.
https://theme-next.org
Other
8.15k stars 2.05k forks source link

5.1.2版本的本地搜索不可用,请问在不升级6.X的情况下如何处理 #1167

Closed simmzl closed 5 years ago

simmzl commented 5 years ago

Expected behavior

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

Actual behavior

点击后,一直loading

Hexo Information

Hexo version

3.8.0

Hexo Configuration

NexT Information

NexT Version:

NexT Scheme:

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的情况下如何处理“本地搜索加载不出来”的问题。

welcome[bot] commented 5 years ago

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

issue-label-bot[bot] commented 5 years ago

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

jiangtj commented 5 years ago

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

simmzl commented 5 years ago

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

CQ STUDIO
CQ STUDIO
A Studio About Shiba Inu.
jiangtj commented 5 years ago

未发现问题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
iissnan/hexo-theme-next
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.
GitHub
iissnan/hexo-theme-next
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.
GitHub
iissnan/hexo-theme-next
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.
GitHub
iissnan/hexo-theme-next
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.
GitHub
iissnan/hexo-theme-next
Elegant theme for Hexo. . Contribute to iissnan/hexo-theme-next development by creating an account on GitHub.
simmzl commented 5 years ago

@jiangtj 文件是一样的。

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

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

jiangtj commented 5 years ago

Clean project with next 5.1.2, seems work fine.

Do you install hexo-generator-search?

image

yeahwu commented 5 years ago

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

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

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

Raincal commented 5 years ago

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

jiangtj commented 5 years ago

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

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

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

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

Raincal commented 5 years ago

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

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

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

stevenjoezhang commented 4 years ago

See also https://github.com/wzpan/hexo-generator-search/commit/8452d5916c440e8fb330fa02596ee823e33167c8 noControlChars filter

stevenjoezhang commented 2 years ago

vscode 中 editor.renderControlCharacters 现在默认是 true 了 https://github.com/microsoft/vscode/pull/136347