hugo-stanley/layouts/_default/_markup/render-image.html

16 lines
517 B
HTML
Raw Normal View History

2020-03-03 18:56:59 +01:00
{{- $url := .Destination | safeURL -}}
{{- $block := gt (len .Title) 0 -}}
{{- if $block -}}
<span class="image-container"><span class="link">
{{- end -}}
<a target="_blank" rel="noopener noreferrer"
href="{{- $url -}}"><img {{ if $block }}class="img"{{ end }} src="{{- $url -}}"
alt{{- with .Text -}}="{{- . -}}" {{- end -}} /></a>
{{- if $block -}}
</span>
{{- if ne .Title " " -}}
<span class="caption"><span class="title">{{- .Title | safeHTML -}}</span></span>
{{- end -}}
</span>
{{- end -}}