Skip to content

Commit 6be40a2

Browse files
committed
Rework language card selections.
Liquid `contains` does (unfortunate...) double duty for both string and array matching and provides no way to create an array-only comparison based on exact equivalence. Consequently...this is the result.
1 parent 5290e3c commit 6be40a2

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

_includes/implementation-card.liquid

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,26 @@
55
<div class="ui selection list">
66
{% if language %}
77
{% assign languages = language | split: ',' %}
8-
{% assign langExp = nil %}
9-
{% for lang in languages %}
10-
{% assign prefixed = lang | prepend: "imp.language contains '" | append: "'" %}
11-
{% assign langExp = langExp | concat: prefixed %}
8+
{% assign imps = implementations | where_exp: 'imp', 'imp.applicationCategory != "CLI"' %}
9+
{% for implementation in imps %}
10+
{% assign found = false %}
11+
{% for implang in implementation.language %}
12+
{% for lang in languages %}
13+
{% if found == false %}
14+
{% assign found = lang == implang %}
15+
{% endif %}
16+
{% endfor %}
17+
{% endfor %}
18+
{% if found == true %}
19+
{% include 'implementation-item' %}
20+
{% endif %}
1221
{% endfor %}
13-
{% assign expression = langExp | join: ' or ' %}
14-
{% assign imps = implementations | where_exp: 'imp', expression | where_exp: 'imp', 'imp.applicationCategory != "CLI"' %}
1522
{% else %}
1623
{% assign imps = implementations | where: 'applicationCategory', applicationCategory %}
24+
{% for implementation in imps %}
25+
{% include 'implementation-item' %}
26+
{% endfor %}
1727
{% endif %}
18-
{% for implementation in imps %}
19-
{% include 'implementation-item' %}
20-
{% endfor %}
2128
</div>
2229
</div>
2330
</div>

0 commit comments

Comments
 (0)