Skip to content

Commit 754f92c

Browse files
committed
fix(search) ignore empty link
1 parent fcb66e8 commit 754f92c

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

dev.html

+8-7
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
<meta charset="UTF-8">
55
<title>docsify</title>
66
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
7-
<link rel="stylesheet" href="/themes/vue.css">
7+
<link rel="stylesheet" href="/themes/vue.css" title="vue">
8+
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled>
9+
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled>
810
</head>
911
<body>
10-
<nav>
12+
<nav data-cloak>
1113
<a href="#/">EN</a>
1214
<a href="#/zh-cn/">中文</a>
1315
</nav>
@@ -19,16 +21,15 @@
1921
'/zh-cn/changelog': '/changelog',
2022
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
2123
},
22-
search: {
23-
maxAge: 0
24-
}
24+
executeScript: true
2525
}
2626
</script>
2727
<script
2828
src="/lib/docsify.js"
29-
data-name="docsify"
29+
data-name="sdfsdf"
30+
data-name-link="//www.baidu.com"
31+
data-base-path="/docs/"
3032
data-load-sidebar
3133
data-sub-max-level="2"
32-
data-base-path="docs/"
3334
data-auto2top></script>
3435
</html>

docs/index.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
88
<meta name="description" content="A magical documentation generator.">
99
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
10-
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
10+
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" title="vue">
11+
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/dark.css" title="dark" disabled>
12+
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/buble.css" title="buble" disabled>
1113
</head>
1214
<body>
1315
<nav data-cloak>

docs/zh-cn/themes.md

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
<link rel="stylesheet" href="//unpkg.com/docsify/themes/dark.css">
99
```
1010

11-
<a id="demo-theme-vue">vue.css</a>
12-
<a id="demo-theme-buble">buble.css</a>
13-
<a id="demo-theme-dark">dark.css</a>
14-
1511
!> CSS 的压缩文件位于 `/lib/themes/`
1612

1713
如果你有其他想法或者想开发别的主题,欢迎提 [PR](https://github.com/QingWei-Li/docsify/pulls)

src/plugins/search/search.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ function getAllPaths () {
2323
const originHref = node.getAttribute('href')
2424
const path = helper.route.parse(href).path
2525

26-
if (paths.indexOf(path) === -1 &&
26+
if (path &&
27+
paths.indexOf(path) === -1 &&
2728
!helper.route.isAbsolutePath(originHref)) {
2829
paths.push(path)
2930
}

0 commit comments

Comments
 (0)