forked from tsc-vfl/hugo-page
23 lines
589 B
HTML
23 lines
589 B
HTML
<figure class="tsc-image">
|
|
{{ with .Get "href" }}
|
|
<a href="{{ . }}">
|
|
{{ end }}
|
|
<img
|
|
{{ with .Get "alt" }}alt="{{ . }}"{{ end }}
|
|
{{- $filename := .Get "src" }}
|
|
{{ $resource := .Page.Resources.Get $filename -}}
|
|
src="{{ $resource.RelPermalink }}"
|
|
style="
|
|
{{- with .Get "width" -}}max-width: min(90%, {{.}}px);{{- end -}}
|
|
"
|
|
>
|
|
{{ with .Get "href" }}
|
|
</a>
|
|
{{ end }}
|
|
{{ with .Get "caption" }}
|
|
<figcaption>
|
|
{{ . }}
|
|
</figcaption>
|
|
{{ end }}
|
|
</figure>
|