问题解准则
我尝试使用docsifyk的搜索功能,但它似乎不起作用。
复制步骤
所以我执行以下步骤:(遵循正式的docsify文档)
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>当前行为
该页面显示搜索按钮,但无论我输入什么,它都返回“无结果”。
其他资料
我在不同的计算机(mac/ubuntu 16)上试过,两者都不能工作。
有谁有过同样的问题吗?
发布于 2020-11-21 07:47:21
我遇到了同样的问题。我发现我做错了什么,第一,这个链接值得一查
确保在这之后有一个_sidebar.md文件和或一个侧栏加一个边条文件,只需添加以下脚本标记
<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>发布于 2021-04-15 09:37:23
这个实现对我来说是可行的:
<script>
window.$docsify = {
loadSidebar: true,
subMaxLevel: 3,
name: '',
repo: '',
search: 'auto', // default
// complete configuration parameters
search: {
maxAge: 86400000, // Expiration time, the default one day
paths: 'auto',
placeholder: 'Type to search',
noData: 'No Results!',
// Headline depth, 1 - 6
depth: 6,
hideOtherSidebarContent: false, // whether or not to hide other sidebar content
}
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>如果您喜欢藻类https://www.npmjs.com/package/docsify-algolia-search-plugin,请检查这个插件
https://stackoverflow.com/questions/59704801
复制相似问题