From 5231bb9a84d177948a5fde46a0d8e2cb7adcb7ea Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Sat, 23 May 2020 17:30:03 +0200 Subject: Make search return page instead of match --- assets/js/search.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'assets/js') diff --git a/assets/js/search.js b/assets/js/search.js index 8784541..8584810 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -26,5 +26,6 @@ var idx = lunr(function () { function do_search(queryterm) { - return idx.search(queryterm); + const result = idx.search(queryterm); + return result.map(r => pages.find((p) => p.id === r.ref)); } -- cgit v1.2.3