Jacky Zhao
2022-01-03 2b432d7f0b35987ca6886e7041dce861b7e21abb
layouts/partials/search.html
@@ -145,7 +145,7 @@
    }
    const redir = (id, term) => {
        window.location.href = "{{.Site.BaseURL}}" + `${id.toLowerCase()}#:~:text=${encodeURIComponent(term)}`
        window.location.href = "{{.Site.BaseURL}}" + `${id}#:~:text=${encodeURIComponent(term)}`
    }
    const fetch = id => ({
@@ -190,9 +190,10 @@
            // 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({