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:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"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.",
|
||||
"keywords": [
|
||||
"indiekit",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
{# Photo gallery with lightbox #}
|
||||
{% 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 totalPhotos = item.photo.length %}
|
||||
<div x-data="{ lightbox: false, idx: 0 }" class="ap-card__gallery ap-card__gallery--{{ displayCount }}">
|
||||
|
||||
Reference in New Issue
Block a user