Back to Hugo

Figure

tpl/tplimpl/embedded/templates/_shortcodes/figure.html

0.161.1718 B
Original Source

{{- if .Get "link" -}} {{- end -}} {{- $u := urls.Parse (.Get "src") -}} {{- $src := $u.String -}} {{- if not $u.IsAbs -}} {{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}} {{- $src = .RelPermalink -}} {{- end -}} {{- end -}} {{- if .Get "link" }}{{ end -}} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} _{{ with (.Get "title") -}} {{ . }} {{- end -}} {{- if or (.Get "caption") (.Get "attr") -}} {{- .Get "caption" | markdownify -}} {{- with .Get "attrlink" }}

    {{- end -}}
    {{- .Get "attr" | markdownify -}}
    {{- if .Get "attrlink" }}{{ end }}
  {{- end }}_

{{- end }}