Skip to content

Commit

Permalink
优化搜索结果 jaywcjlove#86
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 30, 2019
1 parent 50530db commit 367d0c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
10 changes: 6 additions & 4 deletions template/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
}
},
isSreachIndexOF: function (oldstr, kw) {
var istrue = -1;
if (!oldstr || !kw) return -1;
return oldstr.toLowerCase().indexOf(kw.toLowerCase());
},
Expand Down Expand Up @@ -103,11 +102,14 @@
}
}
resultData.sort(function (a, b) {
if (a.nIdx === -1 || b.nIdx === -1) {
return 1;
}
// if (a.nIdx === -1 || b.nIdx === -1) {
// return 1;
// }
return a.nIdx - b.nIdx
}).sort(function(a, b) {
return a.n.length - b.n.length;
});
console.log('resultData:', resultData)
resultData = resultData.slice(0, show_list_count);

for (i = 0; i < resultData.length; i++) {
Expand Down
15 changes: 15 additions & 0 deletions template/styl/mixins/markdown.styl
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,19 @@
margin-top: 0;
margin-bottom: 16px;
}

blockquote {
padding: 0 1em;
color: #6a737d;
border-left: 0.25em solid #dfe2e5;
}

blockquote>:first-child {
margin-top: 0;
}

blockquote>:last-child {
margin-bottom: 0;
}

}

0 comments on commit 367d0c4

Please sign in to comment.