From 4f22d1ef02dda39a9466f0e2d528720997e95ef4 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 5 Dec 2025 00:08:08 -0500 Subject: [PATCH] Only collapse cross-refs when 3+ are hidden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Show +1 or +2 refs expanded inline. Only show the +N collapse indicator when there are 3 or more hidden refs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- kjvstudy_org/templates/chapter.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kjvstudy_org/templates/chapter.html b/kjvstudy_org/templates/chapter.html index 0381c59..90c269c 100644 --- a/kjvstudy_org/templates/chapter.html +++ b/kjvstudy_org/templates/chapter.html @@ -466,9 +466,10 @@ document.body.dataset.resourceReader = 'false'; {% if commentary.cross_reference_groups %} {% set total_refs = commentary.cross_reference_groups | sum(attribute='refs', start=[]) | length %} {% set preview_count = [commentary.cross_reference_groups|length, 3]|min %} + {% set hidden_count = total_refs - preview_count %} - {% for group in commentary.cross_reference_groups[:3] %}{{ group.description }}: {{ group.refs[0].text }}{% if group.refs|length > 1 %}; {% for ref in group.refs[1:] %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% endif %}{% if not loop.last %}. {% endif %}{% endfor %}{% if commentary.cross_reference_groups|length > 3 %}. {% for group in commentary.cross_reference_groups[3:] %}{{ group.description }}: {% for ref in group.refs %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% if not loop.last %}. {% endif %}{% endfor %}{% endif %}{% if total_refs > preview_count %} +{{ total_refs - preview_count }}{% endif %} + {% for group in commentary.cross_reference_groups[:3] %}{{ group.description }}: {{ group.refs[0].text }}{% if group.refs|length > 1 %}{% if hidden_count >= 3 %}; {% for ref in group.refs[1:] %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% else %}; {% for ref in group.refs[1:] %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% endif %}{% endif %}{% if not loop.last %}. {% endif %}{% endfor %}{% if commentary.cross_reference_groups|length > 3 %}{% if hidden_count >= 3 %}. {% for group in commentary.cross_reference_groups[3:] %}{{ group.description }}: {% for ref in group.refs %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% if not loop.last %}. {% endif %}{% endfor %}{% else %}. {% for group in commentary.cross_reference_groups[3:] %}{{ group.description }}: {% for ref in group.refs %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% if not loop.last %}. {% endif %}{% endfor %}{% endif %}{% endif %}{% if hidden_count >= 3 %} +{{ hidden_count }}{% endif %} {% endif %} {% endif %}