问题描述
我尝试使用docsifyk的搜索功能,但似乎不起作用。
重现步骤
所以我执行以下步骤: (遵循官方docsify文档)
- 我在目录中运行“docsify init”,因此它生成“index.html”和“README.md”。
- 我将代码添加到“index.html”中。
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
当前行为
页面显示搜索按钮,但无论我输入什么,它都会返回“无结果”。
其他信息
我在不同的计算机(mac/ubuntu 16)上尝试过,都不起作用
有人有过同样的问题吗?
最佳答案
我也遇到同样的问题。我发现我做错了几件事 首先这个Link值得一看
确保您有一个 _sidebar.md 文件和/或侧边栏文件 Adding a side bar之后只需添加此脚本标签
<script>
window.$docsify = {
loadSidebar: true,
subMaxLevel: 6,
search: {
maxAge: 86400000, // Expiration time, the default one day
paths: 'auto',
placeholder: 'Type to search',
noData: 'No Results!',
depth: 6,
hideOtherSidebarContent: true, // whether or not to hide other sidebar content
}
}
</script>
关于Docsify 搜索插件不起作用,总是不返回任何结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59704801/