Back to Hugo

reflect.IsImageResourceProcessable

docs/content/en/functions/reflect/IsImageResourceProcessable.md

0.161.1637 B
Original Source

{{< new-in 0.157.0 />}}

{{% glossary-term "processable image" %}}

Usage

This example iterates through all project resources and uses reflect.IsImageResourceProcessable to ensure the image pipeline can perform transformations like resizing before processing begins.

go-html-template
{{ range resources.Match "**" }}
  {{ if reflect.IsImageResourceProcessable . }}
    {{ with .Process "resize 300x webp" }}
      
    {{ end }}
  {{ end }}
{{ end }}

{{% include "/_common/functions/reflect/image-reflection-functions.md" %}}