   {{- $id = . }}
{{- end }}

{{- /* Merge class and id attributes. */}}
{{- $attrs = merge $attrs (dict "class" $class "id" $id) }}

{{- /* Create query string. */}}
{{- $mode := "inline" }}
{{- if $displayMode }}
    {{- $mode = "from" }}
{{- end }}
{{- $qs := querify $mode $inner "color" $color }}

{{- /* Get image. */}}
{{- $url := printf "%s?%s" $apiEndpoint $qs }}
{{- $resource := try (resources.GetRemote $url) }}
{{- if $resource }}
    {{- $url = $resource.RelPermalink }}
{{- else }}
    {{- errorf 