add class parameter to iimg shortcode

This commit is contained in:
Helmut Merz 2022-02-15 08:04:34 +01:00
parent edfaa990f1
commit 605e251a32

View file

@ -3,6 +3,7 @@
{{- $ref := .Get "ref" -}}
{{- $scale := .Get "scale" -}}
{{- $alt := or (.Get "alt") (.Get "title") -}}
{{- $class := .Get "class" -}}
{{- $refImg := "" -}}
{{- $refPage := "" -}}
{{- if $ref -}}
@ -22,6 +23,6 @@
<a href="{{ $refPage.Permalink }}"><img
src="{{ $image.RelPermalink }}" alt="{{ or $alt $refPage.Title }}"></a>
{{- else -}}
<img src="{{ $image.RelPermalink }}" alt="{{ $alt }}">
<img src="{{ $image.RelPermalink }}" alt="{{ $alt }}" class="{{ $class }}">
{{- end -}}
</p>