diff --git a/assets/js/theme.js b/assets/js/theme.js index 087110c0..9d852fa8 100644 --- a/assets/js/theme.js +++ b/assets/js/theme.js @@ -372,6 +372,7 @@ class FixIt { } ); autosearch.on('autocomplete:selected', (_event, suggestion, _dataset, _context) => { + document.getElementById('mask')?.click(); window.location.assign(suggestion.uri); }); if (isMobile) { diff --git a/hugo.toml b/hugo.toml index c89f2631..5af42bcc 100644 --- a/hugo.toml +++ b/hugo.toml @@ -496,6 +496,8 @@ snippetLength = 30 highlightTag = "em" # whether to use the absolute URL based on the baseURL in search index absoluteURL = false +# FixIt 0.4.0 | NEW whether to enable anchorify for headings in search results +anchorify = true [params.search.algolia] index = "" diff --git a/layouts/home.search.json b/layouts/home.search.json index 18eae38c..f0907ace 100644 --- a/layouts/home.search.json +++ b/layouts/home.search.json @@ -22,48 +22,72 @@ {{/* Remove line number for code */}} {{- $content = $content | replaceRE ` *\d*\n?` "" -}} {{- $content = $content | replaceRE ` class="heading-element"` "" -}} - {{- $anchor := "" -}} - {{- range $h, $contenth := split $content "

") 0) `"` "" -}} - {{- $contenth = printf "

") 0) `"` "" -}} + {{- $contenth = printf "

") 0) `"` "" -}} + {{- $contenti = printf "

") 0) `"` "" -}} + {{- $contentj = printf "

") 0) `"` "" -}} + {{- $contentk = printf "

") 0) `"` "" -}} + {{- $contentk = printf "

") 0) `"` "" -}} + {{- $contentm = printf "
") 0) `"` "" -}} {{- $contenti = printf "

") 0) `"` "" -}} {{- $contentj = printf "

") 0) `"` "" -}} - {{- $contentk = printf "

") 0) `"` "" -}} - {{- $contentk = printf "

") 0) `"` "" -}} - {{- $contentm = printf "