diff options
author | Oscar Najera <hi@oscarnajera.com> | 2024-12-28 05:21:24 +0100 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2024-12-28 05:21:47 +0100 |
commit | 13d8e69b93c51776cd7fe73961f6873d756a995e (patch) | |
tree | 25c463bc6b399bd76fc1ab2f20c0c2a1c3a5156f /assets/js/search.js | |
parent | b51598c54eefb8881c0e1b163ceca915120759d5 (diff) | |
download | hugo-minimalist-theme-13d8e69b93c51776cd7fe73961f6873d756a995e.tar.gz hugo-minimalist-theme-13d8e69b93c51776cd7fe73961f6873d756a995e.tar.bz2 hugo-minimalist-theme-13d8e69b93c51776cd7fe73961f6873d756a995e.zip |
search translate
Diffstat (limited to 'assets/js/search.js')
-rw-r--r-- | assets/js/search.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/assets/js/search.js b/assets/js/search.js index 2dc147e..ab2256b 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -63,19 +63,15 @@ function renderResults(results) { resultBox.appendChild(resultEntry(value.item, key)) }) } else { - resultBox.innerHTML = - "<p class=\"bg-washed-red pa3 dark-red f4 fw6 tc br2 b--light-red ba\">No matches found</p>" + resultBox.innerHTML = document.getElementById("no-match").innerHTML } } -addEventListener("load", function (){ +addEventListener("load", function () { let searchQuery = getUrlParameter(location.search, "q") if (searchQuery) { document.getElementById("search-query").value = searchQuery executeSearch(searchQuery).then(renderResults) - } else { - document.getElementById("search-results").innerHTML = - "<p class=\"pa3 f4 fw6 tc\">Please enter a word or phrase above</p>" } } ) |