Trying to bundle CSS files

Hi! I’m trying to bundle 2 CSS files and Hugo fails to render pages.

{{ $first := resources.Get "css/style.css" }}
{{ $second := resources.Get "css/style2.css" }}
{{ $bundle := slice $first $second | resources.Concat "css/bundle.css" }}

<link rel="stylesheet" href="{{ $bundle.RelPermalink }}">

Failed to render pages: render of "home" failed: execute of template failed: template: index.html:5:3: executing "head" at <partial "head.html" .>: error calling partial: "D:\gitlab\hugo\claudia\layouts\partials\head.html:42:46": execute of template failed: template: partials/head.html:42:46: executing "partials/head.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat

Paths to the files are correct. What could be the problem?

Hugo Static Site Generator v0.73.0-428907CC windows/amd64 BuildDate: 2020-06-23T16:32:10Z
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.14.3"

compare to (searching firt is a nice way)

Thank you! Creating assets (“Stores all the files which need be processed by Hugo Pipes.”) directory and placing CSS files inside of it did the trick. Lesson learnt.

But the error message isn’t … great.

2 Likes

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