{{- /* Inserting image from URL. @param {string} src The path to the image which must be a remote, page, or global resource. @param {string} align [left|right|center] Image align. @returns {template.HTML} @examples {{< img src="https://example.com/image.png" />}} {{< img src="https://example.com/image.png" >}}Image caption.{{< /img >}} {{< img src="https://example.com/image.png" align="left" >}}Image caption.{{< /img >}} */ -}} {{- if (.Get 0) -}} {{ $file := (.Get "src") }} {{ $align := (.Get "align") }} {{ $aligner := (slice "left" "right" "center") }} {{ $caption := ((.Inner) | markdownify) }} {{ with ($align) }} {{ if (not (in ($aligner) .)) }} {{ (errorf "The align passed to the %q shortcode is invalid. The align must be one of %s. See %s." ($.Name) (delimit ($aligner) ", " ", or ") ($.Position)) }} {{ end }} {{ end }} {{ if (eq ($align) "right") }}{{ $align = "float-end ms-3" }}{{ end }} {{ if (eq ($align) "left") }}{{ $align = "float-start me-3" }}{{ end }} {{ if (eq ($align) "center") }}{{ $align = "d-flex justify-content-center" }}{{ end }}
{{ ($file) }} {{ with ($caption) }}
{{ . }}
{{ end }}
{{- else -}} {{ (partial "alerts/no_params" .) }} {{- end -}}