Using `apply` to convert a slice of strings into resources

I have a slice containing file names of all my resources. I want to convert this slice to a slice of resources, but I can’t do so using apply.

{{ $files := site.Data.vendor.js }}
{{ $bundle := apply $files "resources.Get" (printf "js/vendor/%s" .)  "." }}

How should I go about this?

1 Like