Skip to content

Commit 70f64d0

Browse files
committed
site: limit search sub-results to 5
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent 38f3ab3 commit 70f64d0

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

layouts/partials/search-bar.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@
5757
{{ print "{{#if sub_results}}" }}
5858
<ul class="mt-3 ml-4 flex flex-wrap gap-2">
5959
{{ print "{{#each sub_results as sub}}" }}
60-
<li class="text-sm">
61-
<a class="text-blue-600 dark:text-blue-400 hover:underline" href="{{ print "{{ sub.url | safeUrl }}" }}">
62-
{{ print "{{ sub.title }}" }}
63-
</a>
64-
</li>
60+
{{ print "{{#if (lt @index 5)}}" }}
61+
<li class="text-sm">
62+
<a class="text-blue-600 dark:text-blue-400 hover:underline" href="{{ print "{{ sub.url | safeUrl }}" }}">
63+
{{ print "{{ sub.title }}" }}
64+
</a>
65+
</li>
66+
{{ print "{{/if}}" }}
6567
{{ print "{{/each}}" }}
6668
</ul>
6769
{{ print "{{/if}}" }}

0 commit comments

Comments
 (0)