summaryrefslogtreecommitdiff
path: root/layouts/shortcodes/img.html
blob: 918eff647f762dca450e19146b4b35e1859bbb3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!--
	class: class of the figure
	link: url the image directs to
	alt: alternative text
	caption: caption
	mouse: what the image says when moused over ("title" in HTML)
-->
<a class="picture-link" href="{{ .Get "src"}}">
    <figure {{ with .Get "class" }}class="{{.}}"{{ end -}}>
        {{- with .Get "link"}}<a href="{{.}}">{{ end -}}
        <img src="{{ .Get "src" }}"
             {{- with .Get "mouse" }} title="{{.}}"{{ end -}}
             {{- with .Get "alt" }} alt="{{.}}"{{ end -}}
        >
        {{- if .Get "link"}}</a>{{ end -}}
        {{- with .Get "caption" -}}
        <figcaption>
            {{- . -}}
        </figcaption>
        {{- end -}}
    </figure>
</a>