From 2ba01c831178facd35c62adcb22f3cc39ead6975 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Fri, 24 Dec 2021 20:51:37 +0000
Subject: [PATCH] fix untitled #36
---
layouts/partials/search.html | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/layouts/partials/search.html b/layouts/partials/search.html
index 62556a4..9809de6 100644
--- a/layouts/partials/search.html
+++ b/layouts/partials/search.html
@@ -145,7 +145,7 @@
}
const redir = (id, term) => {
- window.location.href = "{{.Site.BaseURL}}" + `${id}#:~:text=${encodeURIComponent(term)}`
+ window.location.href = "{{.Site.BaseURL}}" + `${id.toLowerCase()}#:~:text=${encodeURIComponent(term)}`
}
const fetch = id => ({
@@ -185,8 +185,8 @@
return [...results[0].result]
}
}
- const allIds = [...getByField('title'), ...getByField('content')]
- const finalResults = allIds.map(fetch)
+ const allIds = new Set([...getByField('title'), ...getByField('content')])
+ const finalResults = [...allIds].map(fetch)
// display
if (finalResults.length === 0) {
@@ -252,4 +252,4 @@
})
})
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.10.0