# Bundle & Minify CSS

**URL:** <https://discourse.gohugo.io/t/bundle-minify-css/32310>\
**Category:** Uncategorized\
**Created:** [April 11, 2021, 12:15pm UTC](https://discourse.gohugo.io/t/bundle-minify-css/32310 "2021-04-11T12:15:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fount-via](https://avatars.discourse-cdn.com/v4/letter/f/6f9a4e/32.png) [@fount-via](https://discourse.gohugo.io/u/fount-via)\
**Post date:** [April 11, 2021, 12:15pm UTC](https://discourse.gohugo.io/t/bundle-minify-css/32310/1 "2021-04-11T12:15:42Z")

</div>

I’d like to bundle static/css/style.css and static/fonts/fonts.css and minify as css/bundle.css using a partial called head.html. I can’t work out why this doesn’t work:

```
{{ $stylea := resources.Get "css/style.css" }}
{{ $styleb := resources.Get "fonts/fonts.css" }}
{{ $css := slice $styleb $stylea | resources.Concat "css/bundle.css" }}
<link href="css/bundle.css" rel="stylesheet">

```

The error generated is:

`[...] execute of template failed: template: partials/head.html:16:52: executing "partials/head.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat`

Can anybody see where I’ve gone wrong?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [April 11, 2021, 12:21pm UTC](https://discourse.gohugo.io/t/bundle-minify-css/32310/2 "2021-04-11T12:21:00Z")

</div>

You need to either put these files inside /assets (or you could also configure it as a mount).

The error message you get here could probably be improved …

---

<div class="post-metadata">

**Author:** ![fount-via](https://avatars.discourse-cdn.com/v4/letter/f/6f9a4e/32.png) [@fount-via](https://discourse.gohugo.io/u/fount-via)\
**Post date:** [April 11, 2021, 12:27pm UTC](https://discourse.gohugo.io/t/bundle-minify-css/32310/3 "2021-04-11T12:27:06Z")

</div>

perfect. /assets it is. Thanks for the rapid reply!

---

<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:** [April 13, 2021, 12:27pm UTC](https://discourse.gohugo.io/t/bundle-minify-css/32310/4 "2021-04-13T12:27:40Z")

</div>

Closed on April 13, 2021, 12:27pm UTC

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