Skip to content

Commit b3ed115

Browse files
authored
Sort the tools by version supported (#609)
1 parent f34de06 commit b3ed115

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,14 @@ <h2 id="{{ category.slug }}">
161161
</thead>
162162
<tbody>
163163
{% assign sponsored_tools = site.data.tools | where: "sponsored", true | sort: 'sponsoredDate' %}
164-
{% assign non_sponsored_tools = site.data.tools | where_exp: "tool", "tool.sponsored == nil or tool.sponsored == false" | sort_natural: 'name' %}
164+
{% assign non_sponsored_all = site.data.tools | where_exp: "tool", "tool.sponsored == nil or tool.sponsored == false" %}
165+
166+
{# Group by supported version, sorted by name within each group #}
167+
{% assign v3_2_tools = non_sponsored_all | where: "v3_2", true | sort_natural: 'name' %}
168+
{% assign v3_1_tools = non_sponsored_all | where_exp: "tool", "tool.v3_2 != true and tool.v3_1 == true" | sort_natural: 'name' %}
169+
{% assign v3_tools = non_sponsored_all | where_exp: "tool", "tool.v3_2 != true and tool.v3_1 != true and tool.v3 == true" | sort_natural: 'name' %}
170+
{% assign no_v3_tools = non_sponsored_all | where_exp: "tool", "tool.v3_2 != true and tool.v3_1 != true and tool.v3 != true" | sort_natural: 'name' %}
171+
{% assign non_sponsored_tools = v3_2_tools | concat: v3_1_tools | concat: v3_tools | concat: no_v3_tools %}
165172

166173
{% assign sorted_tools = sponsored_tools | concat: non_sponsored_tools %}
167174

0 commit comments

Comments
 (0)