[READ-ONLY] Mirror of https://github.com/flo-bit/dogumentation. Simple, minimalistic documentation template using astro flo-bit.dev/dogumentation/
0

Configure Feed

Select the types of activity you want to include in your feed.

improve search

+12 -16
+12 -16
src/components/search/CommandPalette.svelte
··· 37 37 for (let i = 0; i < search.results.length && i < 5; i++) { 38 38 let result = await search.results[i].data(); 39 39 40 - let excerpt = result.excerpt; 41 - // replace <mark> tags with <span class="bg-pink-600/10"> 42 - excerpt = excerpt.replaceAll( 43 - "<mark>", 44 - '<span class="bg-accent-500/20 rounded-md p-0.5">' 45 - ); 46 - excerpt = excerpt.replaceAll("</mark>", "</span>"); 47 - 48 - newResults[i] = { 49 - title: result.meta.title, 50 - content: excerpt, 51 - href: result.url, 52 - }; 40 + for(let j = 0; j < result.sub_results.length; j++) { 41 + newResults.push({ 42 + title: result.sub_results[j].title, 43 + content: result.meta.title, 44 + href: result.sub_results[j].url, 45 + }); 46 + } 53 47 } 54 48 55 - results = Object.values(newResults); 49 + results = newResults.slice(0, 5); 56 50 }; 57 51 58 52 export let value: string = ""; ··· 146 140 currentSelection < results.length 147 141 ) { 148 142 window.location.href = results[currentSelection].href; 149 - } else { 150 - $showSearch = false; 151 143 } 144 + $showSearch = false; 152 145 } 153 146 154 147 // on arrow down ··· 206 199 <!-- Active: "bg-indigo-600 text-white" --> 207 200 {#each results as result, i} 208 201 <a 202 + on:click={() => { 203 + $showSearch = false; 204 + }} 209 205 href={result.href} 210 206 class="w-full {currentSelection === i 211 207 ? 'bg-white/5'