Skip to content

Commit b291cfc

Browse files
committed
Adds sort by widget and subtitle
1 parent 47ba3f1 commit b291cfc

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

src/site/_includes/search-js.njk

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ search.addWidgets([
3434
showSubmit: false,
3535
}),
3636
37+
instantsearch.widgets.sortBy({
38+
container: '#sort-by',
39+
items: [
40+
{ label: 'Newest', value: 'jamstack' },
41+
{ label: 'Popular', value: 'popular' },
42+
],
43+
cssClasses: {
44+
//root: 'MyCustomSortBy',
45+
select: [
46+
'text-black py-1 px-2 rounded-default border border-white bg-white',
47+
],
48+
},
49+
}),
50+
3751
instantsearch.widgets.hits({
3852
snippetEllipsisText: '',
3953
container: '#hits',

src/site/tv.njk

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Jamstack TV
3+
subtitle: Jamstack TV is a searchable collection of video resources. Interested in a topic? Looking for a specific talk? Search here and we’ll find that talk or topic timestamp within the videos for you.
34
layout: layouts/base.njk
45
preconnect:
56
- https://cdn.jsdelivr.net
@@ -8,16 +9,23 @@ javascriptIncludes:
89
---
910
{# This search index data is populated by the code at https://github.com/netlify/jamstack-tv-search-data #}
1011

11-
<div class="p-8 max-w-6xl mx-auto">
12-
<div class="md:mt-20">
13-
<h1 class="text-center">{{ title }}</h1>
14-
</div>
15-
<div class="flex flex-wrap items-center justify-center my-8 max-w-2xl mx-auto">
12+
13+
<section class="md:mt-20">
14+
<h1 class="text-center">{{ title }}</h1>
15+
<p class="text-center">{{ subtitle }}</p>
16+
</section>
17+
18+
<div class="px-8 max-w-6xl mx-auto">
19+
<div class="flex flex-wrap items-center justify-center max-w-2xl mx-auto">
1620
<div id="searchbox" class="flex-grow my-2">
1721
<span class="jamstacktv-js">The search functionality on Jamstack TV requires JavaScript to operate.</span>
1822
</div>
1923
<div class="ml-4 my-2"><img src="/img/svg/search-by-algolia-dark-background.svg" alt="Search by Algolia" width="168" height="24" class="w-auto"/></div>
2024
</div>
21-
<div id="hits" class="mt-20"></div>
25+
<div class="flex items-center justify-end mt-20">
26+
<div class="mr-4">Sort by</div>
27+
<div id="sort-by"></div>
28+
</div>
29+
<div id="hits" class="mt-4"></div>
2230
</div>
2331

0 commit comments

Comments
 (0)