Image Processing help

<img src="{{.Params.Image | absURL }}" alt="{{.Site.Params.author}}" class="img-fluid rounded float-left mr-5 mb-4">

Trying to resize the image referred to by this

{{ $image := $resource.Fit "300x600" }}

Not sure how to plugin this to that

Any help would be great

You mix images in static called by html and resources transformations. Will not work.

  • put image in assets/images
  • use this as a resource
  • untested code :
{{ $path := .Params.Image }}
{{ $original := resources.Get $path }}
{{ $image := $original.Fit "300x600" }}
<img src="{{ $image.RelPermalink }}">

See https://gohugo.io/content-management/image-processing/

Yes, I have been reading that but not understanding how to make it work with what I have.

Don’t really understand sorry I am new at this.

did you try my code ?

1 Like