Title: Issue with hugo pipes
Tags: go;concatenation;bundle;hugo;hugo-shortcode
Question: I am trying to use pipes to bundle my plugins and script modules.
This is my code so far.
{{ $jsBundle := slice }}
{{ $jsBundle = $jsBundle | append resources.Get  &quot;plugins/google-map/map.js&quot;}}
{{ $jsBundle = $jsBundle | append resources.Get &quot;plugins/jquery/jquery.min.js&quot;}}
{{ $jsBundle = $jsBundle | append resources.Get &quot;plugins/lazy-load/lozad.min.js&quot;}}
{{ $jsBundle = $jsBundle | append resources.Get &quot;plugins/magnific-popup/jquery.magnific-popup.min.js&quot; }}
{{ $jsBundle = $jsBundle | append resources.Get &quot;plugins/shuffle/shuffle.min.js&quot;}}
{{ $jsBundle = $jsBundle | append resources.Get &quot;plugins/slick/slick.min.js&quot;}}
{{ $jsBundle = $jsBundle | append resources.Get &quot;js/script.js&quot;}}
{{ $jsBundle = $jsBundle | append resources.Get &quot;js/pricing/boosting.js&quot; }}
{{ $jsBundle = $jsBundle | append resources.Get &quot;js/pricing/coaching.js&quot; }}
{{ $jsBundle = $jsBundle | append resources.Get &quot;js/pricing/placements.js&quot; }}
{{ $jsBundle = $jsBundle | append resources.Get &quot;js/pricing/tourneyTitle.js&quot; }}
--&gt;
{{ $jsBundle := $jsBundle | resources.Concat &quot;js/bundle.js&quot; | fingerprint &quot;sha384&quot; }}
<script src=&quot;{{ $jsBundle.Permalink | absURL }}&quot;&gt;</script&gt;
Whenever I run this code I get this error,
executing &quot;partials/footer.html&quot; at <resources&gt;: wrong number of args for Get: want 1 got 0
So after trying to figure out how to fix this and trying to use filepath insteadof Get to use it I decided to go back to the way the tutorial i first watched did it. That link is here. https://www.youtube.com/watch?v=A20U7KbA4tA You can skip to 17:00 to see where he gets the same exact error and then fixes it. The fix didnt work for me though.
{{ $jsBundle := slice }}
{{ range .Site.Params.plugins.js}}
{{ $jsFile := resources.Get .link | minify }}
{{ $jsBundle := $jsBundle | append $jsFile }}
{{ end }}
{{ $jsBundle := $jsBundle | resources.Concat &quot;js/bundle.js&quot; | fingerprint &quot;sha384&quot; }}
<script src=&quot;{{ $jsBundle.Permalink | absURL }}&quot;&gt;</script&gt;
When I try it this way instead the error message i get is
executing &quot;partials/footer.html&quot; at <resources.Concat&gt;: error calling Concat: slice []interface {} not supported in concat
I can link the repo if neede. but rn it is not pushed fully. I would prefer to use the first way I listed that way i dont have to have multiple ranges for the plugins and the modules, and it lets me easily select what I want to use instead of auto everything.


Here is another answer: Change this:
{{ $jsBundle = $jsBundle | append resources.Get &quot;foo&quot; }}
To this:
{{ $jsBundle = $jsBundle | append (resources.Get &quot;foo&quot;) }}

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:05/13/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<go><concatenation><bundle><hugo><hugo-shortcode>', 'Title': 'Issue with hugo pipes', 'ViewCount': 296, 'id': 67513802, 'user_AboutMe': '<p>I am a drop out college student. I started with Music Composition and then switched to Computer Science. I took a couple of programming classes before I dropped out in c++.</p>\n<p>My goal is to be able to make phone apps to help with my personal day-to-day production. I also am learning tkinter to make basic windows applications.</p>\n<p>For work I am a full time DoorDasher and professional flooring contractor.</p>\n<p>I love just about everything from reading, to playing trumpet, to free climbing.</p>\n', 'user_AccountId': 21531923.0, 'user_DisplayName': 'Kokopelli Gaming', 'user_Reputation': 17.0, 'user_Views': 20.0, 'user_id': 15871241.0}}