I’m attempting to bundle some JS assets, following the example from the docs here: https://gohugo.io/hugo-pipes/bundling/
I’m getting the following error: error calling Concat: slice []interface {} not supported in concat
. Here’s the relevant code in my partial.
{{ $jquery := resources.Get "js/lib/jquery.min.js" }}
{{ $anime := resources.Get "js/lib/anime.min.js" }}
{{ if eq .Site.Params.includeBootstrapJs true }} }}
{{ $bootstrap := resources.Get "js/lib/bootstrap.bundle.min.js" }}
{{ $js := slice $jquery $bootstrap $anime | resources.Concat "js/bundle.js" }}
{{ else }}
{{ $js := slice $jquery $anime | resources.Concat "js/bundle.js" }}
{{ end }}
<script src="{{ "js/bundle.js" | relURL }}"></script>
The assets in question are located in /themes/hugo-base-theme/static/js/lib/
.
I’ve had a look at this issue and not able to understand how the solution there would apply to my use case.
Relevant changes are in this diff.