I’d like to use
{{<figure src="{{<static "blah">}}">}}
where static is a shortcode that gives the absolute path for static content files as follows:
{{- .Scratch.Set "path" (.Get 0) -}}
{{- if hasPrefix (.Scratch.Get "path") "/" -}}
{{- .Scratch.Set "path" (slicestr (.Scratch.Get "path") 1) -}}
{{- end -}}
{{- .Scratch.Get "path" | absLangURL -}}
I cannot get the syntax of nesting right. How can I do this? Alternatively, I also looked into whether Hugo could do something along the lines of
<!-- pseudocode -->
{{capture into path}}{{<static "blah">}}{{end capture}}
{{<figure src="path">}}
but apparently Hugo doesn’t support any concept similar to rendering to a variable.