Programmatically use shortcode inside another shortcode's definition file

ugly solution with copy-pasted and a bit hacked figure.html
$ cat shortcodes/shortcode1.html

{{- $original := .Page.Resources.GetMatch (printf "%s*" (.Get "src")) -}}
{{- $resizeParam := printf "%sx%s" (.Get "width") (.Get "height") -}}
{{- $resized := $original.Resize $resizeParam -}}
{{- .Scratch.Set "src" $resized.RelPermalink -}}
{{- .Scratch.Set "link" $original.RelPermalink -}}
{{- .Scratch.Set "height" $resized.Height -}}
{{- .Scratch.Set "width" $resized.Width -}}
{{- if isset .Params "target" -}}
{{- .Scratch.Set "target" (.Get "target") -}}
{{- end -}}
{{- if isset .Params "rel" -}}
{{- .Scratch.Set "rel" (.Get "rel") -}}
{{- end -}}
{{- if isset .Params "alt" -}}
{{- .Scratch.Set "alt" (.Get "alt") -}}
{{- end -}}
{{- if isset .Params "title" -}}
{{- .Scratch.Set "title" (.Get "title") -}}
{{- end -}}
{{- if isset .Params "caption" -}}
{{- .Scratch.Set "caption" (.Scratch.Get "caption") -}}
{{- else if .Inner -}}
{{- .Scratch.Set "caption" .Inner -}}
{{- end -}}
{{- if isset .Params "class" -}}
{{- .Scratch.Set "class" (.Get "class") -}}
{{- end -}}
{{- if isset .Params "attr" -}}
{{- .Scratch.Set "attr" (.Get "attr") -}}
{{- end -}}
{{- if isset .Params "attrlink" -}}
{{- .Scratch.Set "attrlink" (.Get "attrlink") -}}
{{- end -}}

{{ template "figure-internal" .Scratch }}

{{- define "figure-internal" -}}
<figure{{ with .Get "class" }} class="{{.}}"{{ end }}>
    {{ if .Get "link"}}<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>{{ end }}
        <img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}" {{ end }}{{ with .Get "width" }}width="{{.}}" {{ end }}{{ with .Get "height" }}height="{{.}}" {{ end }}/>
    {{ if .Get "link"}}</a>{{ end }}
    {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
    <figcaption>{{ if .Get "title" }}
        <h4>{{ .Get "title" }}</h4>{{ end }}
        {{ if or (.Get "caption") (.Get "attr")}}<p>
        {{ .Get "caption" }}
        {{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
            {{ .Get "attr" }}
        {{ if .Get "attrlink"}}</a> {{ end }}
        </p> {{ end }}
    </figcaption>
    {{ end }}
</figure>
{{- end -}}