fix(search) ignore empty link

This commit is contained in:
qingwei.li 2017-02-19 13:35:12 +08:00 • committed by cinwell.li
commit 754f92ce8e
4 changed files with 13 additions and 13 deletions

View file

@ -4,10 +4,12 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>docsify</title> <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"> <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> </head>
<body> <body>
<nav> <nav data-cloak>
<a href="#/">EN</a> <a href="#/">EN</a>
<a href="#/zh-cn/">中文</a> <a href="#/zh-cn/">中文</a>
</nav> </nav>
@ -19,16 +21,15 @@
'/zh-cn/changelog': '/changelog', '/zh-cn/changelog': '/changelog',
'/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG' '/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG'
}, },
search: { executeScript: true
maxAge: 0
}
} }
</script> </script>
<script <script
src="/lib/docsify.js" src="/lib/docsify.js"
data-name="docsify" data-name="sdfsdf"
data-name-link="//www.baidu.com"
data-base-path="/docs/"
data-load-sidebar data-load-sidebar
data-sub-max-level="2" data-sub-max-level="2"
data-base-path="docs/"
data-auto2top></script> data-auto2top></script>
</html> </html>

View file

@ -7,7 +7,9 @@
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages"> <meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
<meta name="description" content="A magical documentation generator."> <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"> <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> </head>
<body> <body>
<nav data-cloak> <nav data-cloak>

View file

@ -8,10 +8,6 @@
<link rel="stylesheet" href="//unpkg.com/docsify/themes/dark.css"> <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/` !> CSS 的压缩文件位于 `/lib/themes/`
如果你有其他想法或者想开发别的主题,欢迎提 [PR](https://github.com/QingWei-Li/docsify/pulls)。 如果你有其他想法或者想开发别的主题,欢迎提 [PR](https://github.com/QingWei-Li/docsify/pulls)。

View file

@ -23,7 +23,8 @@ function getAllPaths () {
const originHref = node.getAttribute('href') const originHref = node.getAttribute('href')
const path = helper.route.parse(href).path const path = helper.route.parse(href).path
if (paths.indexOf(path) === -1 && if (path &&
paths.indexOf(path) === -1 &&
!helper.route.isAbsolutePath(originHref)) { !helper.route.isAbsolutePath(originHref)) {
paths.push(path) paths.push(path)
} }