diff options
-rw-r--r-- | search.html | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/search.html b/search.html index fb31595..001facd 100644 --- a/search.html +++ b/search.html @@ -42,11 +42,13 @@ layout: page result.forEach(r => { - var p = pages.filter(p => p.id == r.ref)[0]; + const p = pages.find(p => p.id == r.ref); var li = document.createElement("li") var el = li.appendChild(document.createElement("a")); el.textContent = p.title; el.href = p.url; + el = li.appendChild(document.createElement("span")); + el.textContent = " [score: " + r.score.toString() + "]"; root.appendChild(li); }); |