Skip to content

Commit

Permalink
fix(search) ignore empty link
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Feb 19, 2017
1 parent fcb66e8 commit 754f92c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
15 changes: 8 additions & 7 deletions dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
4 changes: 3 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 0 additions & 4 deletions docs/zh-cn/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 754f92c

Please sign in to comment.