diff --git a/layouts/shortcodes/imgproc.html b/layouts/shortcodes/imgproc.html index 2e167d8..5ebdccd 100644 --- a/layouts/shortcodes/imgproc.html +++ b/layouts/shortcodes/imgproc.html @@ -1,6 +1,7 @@ {{ $original := .Page.Resources.GetMatch (printf "*%s*" (.Get 0)) }} {{ $command := strings.ToLower (printf "%s" (.Get 1)) }} {{ $options := .Get 2 }} +{{ $customAlt := .Get 3 }} {{ if eq $command "fit"}} {{ .Scratch.Set "image" ($original.Fit $options) }} {{ else if eq $command "resize"}} @@ -11,9 +12,13 @@ {{ errorf "Invalid image processing command: Must be one of Fit, Fill or Resize. Is: %s" ($command)}} {{ end }} {{ $image := .Scratch.Get "image" }} +{{ $imgAlt := $original.Title }} +{{ if $customAlt }} +{{ $imgAlt = $customAlt }} +{{ end }}
- + {{ $imgAlt }}