add class parameter to iimg shortcode
This commit is contained in:
parent
edfaa990f1
commit
605e251a32
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
{{- $ref := .Get "ref" -}}
|
{{- $ref := .Get "ref" -}}
|
||||||
{{- $scale := .Get "scale" -}}
|
{{- $scale := .Get "scale" -}}
|
||||||
{{- $alt := or (.Get "alt") (.Get "title") -}}
|
{{- $alt := or (.Get "alt") (.Get "title") -}}
|
||||||
|
{{- $class := .Get "class" -}}
|
||||||
{{- $refImg := "" -}}
|
{{- $refImg := "" -}}
|
||||||
{{- $refPage := "" -}}
|
{{- $refPage := "" -}}
|
||||||
{{- if $ref -}}
|
{{- if $ref -}}
|
||||||
|
@ -22,6 +23,6 @@
|
||||||
<a href="{{ $refPage.Permalink }}"><img
|
<a href="{{ $refPage.Permalink }}"><img
|
||||||
src="{{ $image.RelPermalink }}" alt="{{ or $alt $refPage.Title }}"></a>
|
src="{{ $image.RelPermalink }}" alt="{{ or $alt $refPage.Title }}"></a>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
<img src="{{ $image.RelPermalink }}" alt="{{ $alt }}">
|
<img src="{{ $image.RelPermalink }}" alt="{{ $alt }}" class="{{ $class }}">
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</p>
|
</p>
|
Loading…
Add table
Reference in a new issue