Skip to content

Commit 367d0c4

Browse files
committed
优化搜索结果 jaywcjlove#86
1 parent 50530db commit 367d0c4

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

template/js/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
}
4141
},
4242
isSreachIndexOF: function (oldstr, kw) {
43-
var istrue = -1;
4443
if (!oldstr || !kw) return -1;
4544
return oldstr.toLowerCase().indexOf(kw.toLowerCase());
4645
},
@@ -103,11 +102,14 @@
103102
}
104103
}
105104
resultData.sort(function (a, b) {
106-
if (a.nIdx === -1 || b.nIdx === -1) {
107-
return 1;
108-
}
105+
// if (a.nIdx === -1 || b.nIdx === -1) {
106+
// return 1;
107+
// }
109108
return a.nIdx - b.nIdx
109+
}).sort(function(a, b) {
110+
return a.n.length - b.n.length;
110111
});
112+
console.log('resultData:', resultData)
111113
resultData = resultData.slice(0, show_list_count);
112114

113115
for (i = 0; i < resultData.length; i++) {

template/styl/mixins/markdown.styl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,19 @@
216216
margin-top: 0;
217217
margin-bottom: 16px;
218218
}
219+
220+
blockquote {
221+
padding: 0 1em;
222+
color: #6a737d;
223+
border-left: 0.25em solid #dfe2e5;
224+
}
225+
226+
blockquote>:first-child {
227+
margin-top: 0;
228+
}
229+
230+
blockquote>:last-child {
231+
margin-bottom: 0;
232+
}
233+
219234
}

0 commit comments

Comments
 (0)