Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

搜索功能能直接搜索出 css 或 js 文件内容,不知道是 BUG 还是机制 #457

Open
3 tasks done
resetsix opened this issue May 3, 2024 · 6 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@resetsix
Copy link

resetsix commented May 3, 2024

检查清单

  • 已经阅读过 官方文档 相关内容,并尝试进行搜索。
  • 尝试过在本地测试运行官方 demo 源码。
  • 尝试过在 Codespace 中测试运行官方 demo 源码。

问题描述

我觉得搜索功正常应该是搜索博客内容,但会搜索出 css 和 js 内容。比如输入a等等之类的

@L33Z22L11
Copy link
Contributor

请修改配置文件如下:

search:
  local_search:
    field: post

@resetsix
Copy link
Author

resetsix commented May 4, 2024

search

原来是这个,谢谢

@resetsix resetsix closed this as completed May 4, 2024
@L33Z22L11
Copy link
Contributor

@xaoxuu 是否有必要修改主题的默认配置文件

@xaoxuu
Copy link
Owner

xaoxuu commented May 5, 2024

我的就是默认的,搜索a出来的结果都是文章/文档内容,没有css和js文件内容。

@L33Z22L11
Copy link
Contributor

local-search的检索范围设置为all时,会检索source/目录下的所有文件。因此,如果在这个目录下添加了自定义CSS/JS文件的话,主题的默认配置会检索到这些文件。

@xaoxuu
Copy link
Owner

xaoxuu commented May 6, 2024

我想办法过滤一下

@xaoxuu xaoxuu reopened this May 6, 2024
@xaoxuu xaoxuu added the bug Something isn't working label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants