fix(search): dont search nameLink, fixed #102

This commit is contained in:
qingwei.li 2017-02-24 20:15:15 +08:00 committed by cinwell.li
parent 83ae93cae0
commit 507d9e834c
3 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@
## Features
- No statically built html files
- Simple and lightweight (~14kB gzipped)
- Simple and lightweight (~16kB gzipped)
- Smart full-text search plugin
- Multiple themes
- Useful plugin API

View File

@ -31,7 +31,7 @@ export function main (config) {
'</button>' +
'<aside class="sidebar">' +
(config.name
? `<h1><a href="${config.nameLink}">${config.name}</a></h1>`
? `<h1><a data-nosearch href="${config.nameLink}">${config.name}</a></h1>`
: '') +
'<div class="sidebar-nav"></div>' +
'</aside>')

View File

@ -17,7 +17,7 @@ function escapeHtml (string) {
function getAllPaths () {
const paths = []
helper.dom.findAll('a')
helper.dom.findAll('a:not(data-nosearch)')
.map(node => {
const href = node.href
const originHref = node.getAttribute('href')