Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rework logic to group items by the "builtin" key
This obviates the need for the Prettier workaround.
  • Loading branch information
fanninpm committed Nov 5, 2025
commit 417863874015d67808b0bd4eba8598754a4b7745
23 changes: 10 additions & 13 deletions _layouts/whats_left.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,15 @@
</div>

<div class="section-title">What's left: Built-in Items</div>
{% assign previous_builtin = "" %}
{% comment %}<div><ol><!-- this makes prettier not crash -->{% endcomment %}
{% for item in site.data.whats_left.builtin_items %}
{% if item.builtin != previous_builtin %}
{% if previous_builtin != "" %}
</ol></div>
{% endif %}
<h4>{{ item.builtin }}</h4>
<div class="column-count-is-2"><ol>
{% endif %}
<li class="word-wrap-anywhere"><code>{{ item.name }}</code> {% if item.is_inherited %}{{ item.is_inherited }}{% endif %}</li>
{% assign previous_builtin = item.builtin %}
{% assign items_by_builtin = site.data.whats_left.builtin_items | group_by: "builtin" %}
{% for group in items_by_builtin %}
<h4>{{ group.name }}</h4>
<div class="column-count-is-2">
<ol>
{% for item in group.items %}
<li class="word-wrap-anywhere"><code>{{ item.name }}</code> {% if item.is_inherited %}{{ item.is_inherited }}{% endif %}</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a minor formatting issue here that results in an extraneous trailing space when item.is_inherited is not present. This happens because the space before the if statement is unconditional. Moving the space inside the conditional block will ensure it only appears when needed.

          <li class="word-wrap-anywhere"><code>{{ item.name }}</code>{% if item.is_inherited %} {{ item.is_inherited }}{% endif %}</li>

{% endfor %}
</ol>
</div>
{% endfor %}
</ol></div>
</div>