Skip to content

Commit 507d9e8

Browse files
committed
fix(search): dont search nameLink, fixed #102
1 parent 83ae93c commit 507d9e8

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
## Features
2222

2323
- No statically built html files
24-
- Simple and lightweight (~14kB gzipped)
24+
- Simple and lightweight (~16kB gzipped)
2525
- Smart full-text search plugin
2626
- Multiple themes
2727
- Useful plugin API

src/core/render/tpl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function main (config) {
3131
'</button>' +
3232
'<aside class="sidebar">' +
3333
(config.name
34-
? `<h1><a href="${config.nameLink}">${config.name}</a></h1>`
34+
? `<h1><a data-nosearch href="${config.nameLink}">${config.name}</a></h1>`
3535
: '') +
3636
'<div class="sidebar-nav"></div>' +
3737
'</aside>')

src/plugins/search/search.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function escapeHtml (string) {
1717
function getAllPaths () {
1818
const paths = []
1919

20-
helper.dom.findAll('a')
20+
helper.dom.findAll('a:not(data-nosearch)')
2121
.map(node => {
2222
const href = node.href
2323
const originHref = node.getAttribute('href')

0 commit comments

Comments
 (0)