From cc20a236ee0fcd9a65a88ad6dc1a62d9eda34fb0 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Thu, 15 Jan 2026 08:45:10 +0100 Subject: [PATCH] updated --- glance-system/glance-kisfenyo.yaml | 85 ++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 29 deletions(-) diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index c64515e..16eb5fb 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -661,9 +661,9 @@ data: .meallink { display:block; color:inherit; text-decoration:none; } - {{ $base := .Options.StringOr "base_url" "" }} + {{ $base := .Options.StringOr "base_url" "https://tandoor.dooplex.hu" }} - {{/* Handle both: array response OR paginated {results:[...]} */}} + {{/* Handle both: paginated {results:[...]} OR array response */}} {{ $recipes := .JSON.Array "results" }} {{ if eq (len $recipes) 0 }} {{ $recipes = .JSON.Array "" }} @@ -687,15 +687,6 @@ data: {{ $i1 := mod (add $i0 1) $n }} {{ $i2 := mod (add $i0 2) $n }} - {{ $r0 := index $recipes $i0 }} - {{ $r1 := index $recipes $i1 }} - {{ $r2 := index $recipes $i2 }} - - {{/* images are already absolute in your API output */}} - {{ $img0 := $r0.String "image" }} - {{ $img1 := $r1.String "image" }} - {{ $img2 := $r2.String "image" }} -
Today’s picks ({{ printf "%d" $n }} total) @@ -703,31 +694,67 @@ data:
- - + {{/* Slide 1 */}} + {{ range $i, $r := $recipes }} + {{ if eq $i $i0 }} + {{ $id := $r.Int "id" }} + {{ $name := $r.String "name" }} + {{ $img := $r.String "image" }} + {{ if and $img (not (hasPrefix "http" $img)) }}{{ $img = print $base $img }}{{ end }} + + {{ end }} + {{ end }} + + {{/* Slide 2 */}} + {{ range $i, $r := $recipes }} + {{ if eq $i $i1 }} + {{ $id := $r.Int "id" }} + {{ $name := $r.String "name" }} + {{ $img := $r.String "image" }} + {{ if and $img (not (hasPrefix "http" $img)) }}{{ $img = print $base $img }}{{ end }} + + {{ end }} + {{ end }} + + {{/* Slide 3 */}} + {{ range $i, $r := $recipes }} + {{ if eq $i $i2 }} + {{ $id := $r.Int "id" }} + {{ $name := $r.String "name" }} + {{ $img := $r.String "image" }} + {{ if and $img (not (hasPrefix "http" $img)) }}{{ $img = print $base $img }}{{ end }} + + {{ end }} + {{ end }} -
{{ end }} + # ---------- CENTER COLUMN ---------- - size: full widgets: