github.com/e154/smart-home@v0.17.2-0.20240311175135-e530a6e5cd45/doc/themes/docsy/layouts/shortcodes/figure.html (about)

     1  {{ $src := (.Page.Resources.GetMatch (printf "**%s*" (.Get "src"))) }}
     2  <figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
     3      {{- if .Get "link" -}}
     4          <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
     5      {{- end }}
     6      <img src="{{ if $src }}{{ $src.RelPermalink }}{{ else }}{{ .Get "src" }}{{ end }}" 
     7           {{- if or (.Get "alt") (.Get "caption") }}
     8           alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
     9           {{- end -}}
    10           {{- with .Get "width" }} width="{{ . }}"{{ end -}}
    11           {{- with .Get "height" }} height="{{ . }}"{{ end -}}
    12      /> <!-- Closing img tag -->
    13      {{- if .Get "link" }}</a>{{ end -}}
    14      {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
    15          <figcaption>
    16              {{ with (.Get "title") -}}
    17                  <h4>{{ . }}</h4>
    18              {{- end -}}
    19              {{- if or (.Get "caption") (.Get "attr") -}}<p>
    20                  {{- .Get "caption" | markdownify -}}
    21                  {{- with .Get "attrlink" }}
    22                      <a href="{{ . }}">
    23                  {{- end -}}
    24                  {{- .Get "attr" | markdownify -}}
    25                  {{- if .Get "attrlink" }}</a>{{ end }}</p>
    26              {{- end }}
    27          </figcaption>
    28      {{- end }}
    29  </figure>