From 7254b06e13b91a5dffeea2ea157ea6a3dec39466 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 15 Jan 2026 09:02:55 +0100 Subject: [PATCH] testing again --- glance-system/glance-kisfenyo.yaml | 92 +++++++++++++----------------- 1 file changed, 39 insertions(+), 53 deletions(-) diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index a8ac4e8..b2d5fa9 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -662,14 +662,9 @@ data: {{ $base := .Options.StringOr "base_url" "https://tandoor.dooplex.hu" }} - - {{/* Handle both: paginated {results:[...]} OR array response */}} {{ $recipes := .JSON.Array "results" }} - {{ if eq (len $recipes) 0 }} - {{ $recipes = .JSON.Array "" }} - {{ end }} - {{ $n := len $recipes }} + {{ if lt $n 1 }}
No recipes returned from Tandoor.
@@ -687,6 +682,22 @@ data: {{ $i1 := mod (add $i0 1) $n }} {{ $i2 := mod (add $i0 2) $n }} + {{ $p0 := print "results." $i0 }} + {{ $p1 := print "results." $i1 }} + {{ $p2 := print "results." $i2 }} + + {{ $id0 := .JSON.Int (print $p0 ".id") }} + {{ $nm0 := .JSON.String (print $p0 ".name") }} + {{ $im0 := .JSON.String (print $p0 ".image") }} + + {{ $id1 := .JSON.Int (print $p1 ".id") }} + {{ $nm1 := .JSON.String (print $p1 ".name") }} + {{ $im1 := .JSON.String (print $p1 ".image") }} + + {{ $id2 := .JSON.Int (print $p2 ".id") }} + {{ $nm2 := .JSON.String (print $p2 ".name") }} + {{ $im2 := .JSON.String (print $p2 ".image") }} +
Today’s picks ({{ printf "%d" $n }} total) @@ -694,60 +705,35 @@ data:
- - {{/* Slide 1 */}} - {{ range $i, $r := $recipes }} - {{ if eq $i $i0 }} - {{ $id := $r.Int "id" }} - {{ $name := $r.String "name" }} - {{ $img := $r.String "image" }} -
- -
- {{ if $img }}{{ else }}
No image
{{ end }} -
-
{{ $name }}
-
+ - {{/* Slide 2 */}} - {{ range $i, $r := $recipes }} - {{ if eq $i $i1 }} - {{ $id := $r.Int "id" }} - {{ $name := $r.String "name" }} - {{ $img := $r.String "image" }} - + {{ end }}