fix: replace nonexistent Nunjucks min filter with inline conditional

The | min filter is Jinja2 syntax, not available in Nunjucks. This caused
"filter not found: min" crashes when posts had photos (never triggered
before the async iteration fix because photo arrays were always empty).
This commit is contained in:
Ricardo
2026-02-24 11:14:55 +01:00
parent 4052eebc9d
commit 4e159bfb9d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@rmdes/indiekit-endpoint-activitypub", "name": "@rmdes/indiekit-endpoint-activitypub",
"version": "2.0.19", "version": "2.0.20",
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
"keywords": [ "keywords": [
"indiekit", "indiekit",
+1 -1
View File
@@ -2,7 +2,7 @@
{# Photo gallery with lightbox #} {# Photo gallery with lightbox #}
{% if item.photo and item.photo.length > 0 %} {% if item.photo and item.photo.length > 0 %}
{% set displayCount = [item.photo.length, 4] | min %} {% set displayCount = item.photo.length if item.photo.length < 4 else 4 %}
{% set extraCount = item.photo.length - 4 %} {% set extraCount = item.photo.length - 4 %}
{% set totalPhotos = item.photo.length %} {% set totalPhotos = item.photo.length %}
<div x-data="{ lightbox: false, idx: 0 }" class="ap-card__gallery ap-card__gallery--{{ displayCount }}"> <div x-data="{ lightbox: false, idx: 0 }" class="ap-card__gallery ap-card__gallery--{{ displayCount }}">