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
commit 507d9e834c
3 changed files with 3 additions and 3 deletions

View file

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

View file

@ -31,7 +31,7 @@ export function main (config) {
'</button>' + '</button>' +
'<aside class="sidebar">' + '<aside class="sidebar">' +
(config.name (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>' + '<div class="sidebar-nav"></div>' +
'</aside>') '</aside>')

View file

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