mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix(search) ignore empty link
This commit is contained in:
parent
fcb66e8bc7
commit
754f92ce8e
15
dev.html
15
dev.html
@ -4,10 +4,12 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>docsify</title>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="/themes/vue.css">
|
||||
<link rel="stylesheet" href="/themes/vue.css" title="vue">
|
||||
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled>
|
||||
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled>
|
||||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<nav data-cloak>
|
||||
<a href="#/">EN</a>
|
||||
<a href="#/zh-cn/">中文</a>
|
||||
</nav>
|
||||
@ -19,16 +21,15 @@
|
||||
'/zh-cn/changelog': '/changelog',
|
||||
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
|
||||
},
|
||||
search: {
|
||||
maxAge: 0
|
||||
}
|
||||
executeScript: true
|
||||
}
|
||||
</script>
|
||||
<script
|
||||
src="/lib/docsify.js"
|
||||
data-name="docsify"
|
||||
data-name="sdfsdf"
|
||||
data-name-link="//www.baidu.com"
|
||||
data-base-path="/docs/"
|
||||
data-load-sidebar
|
||||
data-sub-max-level="2"
|
||||
data-base-path="docs/"
|
||||
data-auto2top></script>
|
||||
</html>
|
||||
|
||||
@ -7,7 +7,9 @@
|
||||
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
|
||||
<meta name="description" content="A magical documentation generator.">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" title="vue">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/dark.css" title="dark" disabled>
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/buble.css" title="buble" disabled>
|
||||
</head>
|
||||
<body>
|
||||
<nav data-cloak>
|
||||
|
||||
@ -8,10 +8,6 @@
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/dark.css">
|
||||
```
|
||||
|
||||
<a id="demo-theme-vue">vue.css</a>
|
||||
<a id="demo-theme-buble">buble.css</a>
|
||||
<a id="demo-theme-dark">dark.css</a>
|
||||
|
||||
!> CSS 的压缩文件位于 `/lib/themes/`
|
||||
|
||||
如果你有其他想法或者想开发别的主题,欢迎提 [PR](https://github.com/QingWei-Li/docsify/pulls)。
|
||||
|
||||
@ -23,7 +23,8 @@ function getAllPaths () {
|
||||
const originHref = node.getAttribute('href')
|
||||
const path = helper.route.parse(href).path
|
||||
|
||||
if (paths.indexOf(path) === -1 &&
|
||||
if (path &&
|
||||
paths.indexOf(path) === -1 &&
|
||||
!helper.route.isAbsolutePath(originHref)) {
|
||||
paths.push(path)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user