Closed aleixripoll closed 10 months ago
Search module only displays images with absolute URLs, the context is not sent to thesearchImage partial so it uses the default "dot":
searchImage
https://github.com/gethugothemes/hugo-modules/blob/c3e6f1eb8b7b49571bf0d102cd2647beac1b5937/search/layouts/_default/list.searchindex.json#L20-L28
For page bundles, Context must be set to .Page:
Context
.Page
{{- if .Params.image -}} {{- $.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 "Context" .Page "Src" . "Size" "420x" "Command" "Resize")) -}} {{- $.Scratch.Set "imageSM" (partial "searchImage" (dict "Context" .Page "Src" . "Size" "100x100" "Command" "Fill")) -}} {{- end -}} {{- end -}}
hey @aleixripoll you can create a PR, and contribute to this awesome search module.
Search module only displays images with absolute URLs, the context is not sent to the
searchImage
partial so it uses the default "dot":https://github.com/gethugothemes/hugo-modules/blob/c3e6f1eb8b7b49571bf0d102cd2647beac1b5937/search/layouts/_default/list.searchindex.json#L20-L28
For page bundles,
Context
must be set to.Page
: