# Is it possible to programatically include resources in a slice?

**URL:** <https://discourse.gohugo.io/t/is-it-possible-to-programatically-include-resources-in-a-slice/28659>\
**Category:** support\
**Created:** [October 4, 2020, 4:25pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-programatically-include-resources-in-a-slice/28659 "2020-10-04T16:25:15Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![NullSense](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/nullsense/32/12507_2.png) [@NullSense](https://discourse.gohugo.io/u/NullSense)\
**Post date:** [October 8, 2020, 1:04pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-programatically-include-resources-in-a-slice/28659/21 "2020-10-08T13:04:58Z")

</div>

> [@pointyfar](#):
>
> `{{ $script := $allScripts | resources.Concat "js/main-bundle.js" | minify | fingerprint -}}`

Thanks! That fixed it 🙂. I noticed my logic was flawed, as the resources won’t get loaded on each page load, but rather loaded once, so I suppose I either need to make a few payloads: a main one, and ones where they are necessary. Or make a single large payload, which I was doing before. Not sure what is more optimal.

---

<div class="post-metadata">

**Author:** ![SanmayJoshi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/sanmayjoshi/32/9451_2.png) [@SanmayJoshi](https://discourse.gohugo.io/u/SanmayJoshi)\
**Post date:** [October 8, 2020, 2:34pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-programatically-include-resources-in-a-slice/28659/22 "2020-10-08T14:34:10Z")

</div>

Glad it was solved, and we could be of help! Feel free to mark this topic as solved!

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [October 10, 2020, 2:34pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-programatically-include-resources-in-a-slice/28659/23 "2020-10-10T14:34:12Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.gohugo.io/t/is-it-possible-to-programatically-include-resources-in-a-slice/28659.md?page=1)
