mirror of
https://github.com/Vonng/ddia.git
synced 2025-09-26 23:09:18 +08:00
22 lines
653 B
HTML
22 lines
653 B
HTML
{{- $src := .Get "src" -}}
|
|
{{- $link := .Get "link" -}}
|
|
|
|
<figure
|
|
{{ with .Get "id" }}id="{{ . }}"{{ end }}
|
|
{{ with .Get "class" }}class="{{ . }}"{{ end }}
|
|
>
|
|
{{- if $src -}}
|
|
{{- with $link }}<a href="{{ . }}">{{ end -}}
|
|
<img
|
|
src="{{ $src }}"
|
|
{{ with .Get "alt" }}alt="{{ . }}"{{ end }}
|
|
{{ with .Get "width" }}width="{{ . }}"{{ end }}
|
|
{{ with .Get "height" }}height="{{ . }}"{{ end }}
|
|
/>
|
|
{{- if $link }}</a>{{ end -}}
|
|
{{- end -}}
|
|
|
|
{{ with .Get "title" }}<h4>{{ . }}</h4>{{ end }}
|
|
{{ with .Get "caption" }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
|
</figure>
|
|
{{- if $src }}<br />{{- end -}} |