hugo-stanley/layouts/_default/_markup/render-image.html
2020-03-03 18:56:59 +01:00

16 lines
517 B
HTML

{{- $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 -}}