From 2b432d7f0b35987ca6886e7041dce861b7e21abb Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 03 Jan 2022 01:02:47 +0000
Subject: [PATCH] fix flex gap
---
layouts/partials/search.html | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/layouts/partials/search.html b/layouts/partials/search.html
index 62556a4..5544bc1 100644
--- a/layouts/partials/search.html
+++ b/layouts/partials/search.html
@@ -185,14 +185,15 @@
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) {
- results.innerHTML = `<div class="result-card">
- <p>No results.</p>
- </div>`
+ results.innerHTML = `<button class="result-card">
+ <h3>No results.</h3>
+ <p>Try another search term?</p>
+ </button>`
} else {
results.innerHTML = finalResults
.map(result => resultToHTML({
@@ -252,4 +253,4 @@
})
})
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.10.0