14 lines
456 B
HTML
14 lines
456 B
HTML
{{ $url := .Destination }}
|
|
<figure>
|
|
{{ if or (hasPrefix $url "/") (hasPrefix $url "https://") (hasPrefix $url "http://") }}
|
|
{{ else }}
|
|
{{ $url = (printf "%s%s" .Page.Permalink $url) }}
|
|
{{ end }}
|
|
<a href="{{ $url | absURL }}" class="lbox">
|
|
<img src="{{ $url | absURL }}" loading="lazy"{{ with .Text }} alt="{{ . }}"{{ end }}{{ with .Title}} title="{{ . }}"{{ end }}>
|
|
</a>
|
|
{{ with .Title }}
|
|
<figcaption>{{ . }}</figcaption>
|
|
{{ end }}
|
|
</figure>
|