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"
ju52
June 26, 2020, 8:52am
2
compare to (searching firt is a nice way)
When building the site to /public, is it possible to enforce minification of CSS files that reside in /static?
Also, a second question. Is it possible to tell Hugo to join all CSS files into one (while respecting the order in which they are loaded by <head>?
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.
bep
June 26, 2020, 11:00am
4
But the error message isn’t … great.
opened 11:00AM - 26 Jun 20 UTC
Bug
```
<resources.Concat>: error calling Concat: slice []interface {} not support… ed in concat
```
The above is probably a slice of `nil`-- which means that the resources in the previous step wasn't found -- which would be a better error message.
2 Likes
system
Closed
June 28, 2020, 11:01am
5
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.