Hi,
Thanks for Hugo - it’s awesome.
I’m building my very own custom theme and ran into the same issue that some other people had but couldn’t find any working solution.
I’m still getting this error in late 2022:
error calling Concat: slice interface {} not supported in concat
I’m trying to concatenate 3 Javascript files and bundle them into one bundle.js file.
Basically Popper, Bootstrap and one custom Javascript file.
My _default/baseof.html looks like this.
`<body class="light" id="top">
{{ template "header" . }}
{{ template "main" . }}
{{ template "footer" . }}
{{ template "contact-button" . }}
{{ template "modal-search" . }}
{{ $global := resources.Get "js/popper.min.js" }}
{{ $global := resources.Get "js/bootstrap.min.js" }}
{{ $plugin := resources.Get "js/actions.js"}}
{{ $js := slice $global $plugin | resources.Concat "js/bundle.js" }}
<script src="{{ $js.Permalink }}" integrity="{{ $js.Data.Integrity }}"></script>
</body>
`
In my config.toml I’ve also tried playing around with the modules.mounts configuration as it was mentioned in some other posts but without success.
However, I’m highly confused on what the current state of the art is on this matter in 2022.
Since the documentation is three lines long, I’d appreciate it if somebody could maybe post or point to a working example with all things required, not just some pieces one can’t figure out where to put.
I’m using hugo v0.102.3 +extended windows/amd64 BuildDate=2022-09-01T10:16:19Z
Thanks alot in advance.