Skip to content

Commit 4178638

Browse files
committed
Rework logic to group items by the "builtin" key
This obviates the need for the Prettier workaround.
1 parent b451253 commit 4178638

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

_layouts/whats_left.html

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,15 @@
4242
</div>
4343

4444
<div class="section-title">What's left: Built-in Items</div>
45-
{% assign previous_builtin = "" %}
46-
{% comment %}<div><ol><!-- this makes prettier not crash -->{% endcomment %}
47-
{% for item in site.data.whats_left.builtin_items %}
48-
{% if item.builtin != previous_builtin %}
49-
{% if previous_builtin != "" %}
50-
</ol></div>
51-
{% endif %}
52-
<h4>{{ item.builtin }}</h4>
53-
<div class="column-count-is-2"><ol>
54-
{% endif %}
55-
<li class="word-wrap-anywhere"><code>{{ item.name }}</code> {% if item.is_inherited %}{{ item.is_inherited }}{% endif %}</li>
56-
{% assign previous_builtin = item.builtin %}
45+
{% assign items_by_builtin = site.data.whats_left.builtin_items | group_by: "builtin" %}
46+
{% for group in items_by_builtin %}
47+
<h4>{{ group.name }}</h4>
48+
<div class="column-count-is-2">
49+
<ol>
50+
{% for item in group.items %}
51+
<li class="word-wrap-anywhere"><code>{{ item.name }}</code> {% if item.is_inherited %}{{ item.is_inherited }}{% endif %}</li>
52+
{% endfor %}
53+
</ol>
54+
</div>
5755
{% endfor %}
58-
</ol></div>
5956
</div>

0 commit comments

Comments
 (0)