Skip to content

Commit

Permalink
Set image context param to .Page
Browse files Browse the repository at this point in the history
  • Loading branch information
aleixripoll committed Nov 24, 2023
1 parent 37017d0 commit 27be1f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions search/layouts/_default/list.searchindex.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
{{- $date:= time.Format ":date_long" .PublishDate -}}

{{- if .Params.image -}}
{{- $.Scratch.Set "image" (partial "searchImage" (dict "Src" .Params.image "Size" "420x" "Command" "Resize")) -}}
{{- $.Scratch.Set "imageSM" (partial "searchImage" (dict "Src" .Params.image "Size" "100x100" "Command" "Fill")) -}}
{{- $.Scratch.Set "image" (partial "searchImage" (dict "Context" .Page "Src" .Params.image "Size" "420x" "Command" "Resize")) -}}
{{- $.Scratch.Set "imageSM" (partial "searchImage" (dict "Context" .Page "Src" .Params.image "Size" "100x100" "Command" "Fill")) -}}
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
{{- $.Scratch.Set "image" (partial "searchImage" (dict "Src" . "Size" "420x" "Command" "Resize")) -}}
{{- $.Scratch.Set "imageSM" (partial "searchImage" (dict "Src" . "Size" "100x100" "Command" "Fill")) -}}
{{- $.Scratch.Set "image" (partial "searchImage" (dict "Context" .Page "Src" . "Size" "420x" "Command" "Resize")) -}}
{{- $.Scratch.Set "imageSM" (partial "searchImage" (dict "Context" .Page "Src" . "Size" "100x100" "Command" "Fill")) -}}
{{- end -}}
{{- end -}}

Expand Down

0 comments on commit 27be1f6

Please sign in to comment.