{{- /*
  Validate if the given path has a valid suffix.
  @param Path string The path to validate.
  @param Suffixes []string The list of valid suffixes.
  @return bool True if the path has a valid suffix, false otherwise.

  @example
  {{- $suffixList := slice ".jpeg" ".jpg" ".png" ".gif" ".bmp" ".tif" ".tiff" ".webp" ".avif" ".svg" -}}
  {{- $suffixValid := (dict "Path" .Path "Suffixes" $suffixList | partial "function/suffix-validation.html") -}}
*/ -}}
{{- $url := urls.Parse .Path -}}
{{- $path := path.Clean ((printf "%v%v" $url.Host $url.Path) | lower) -}}
{{- with $url.Scheme -}}
  {{- $path = printf "%v://%v" . $path -}}
{{- end -}}
{{- $suffix := path.Ext $path -}}
{{- $suffixes := .Suffixes | default slice -}}
{{- $suffixValid := in $suffixes $suffix -}}
{{- return $suffixValid -}}
