Welcome to mirror list, hosted at ThFree Co, Russian Federation.

render-image.html « _markup « _default « layouts - github.com/cntrump/hugo-notepadium.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8078e87499d236a2b85649fe8c979b0754139fc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{{- $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 -}}