Wrong type for value error when running resources.Minify

Running this in /layouts/index.html

{{ $styles := resources.Get "css/styles.css" | resources.Minify }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" media="screen" />

I get the following error:

ERROR 2021/03/29 16:47:57 Failed to render pages: render of “home” failed: “/mnt/c/Users/yashb/quickstart/layouts/index.html:8:51”: execute of template failed: template: index.html:8:51: executing “index.html” at : wrong type for value; expected resources.ResourceTransformer; got resource.Resource

My CSS file is located at /public/assets/css/styles.css

Your CSS should be un /assets/, not /public/assets/.

1 Like

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