HUGO

Invalid dictionary call

Hello,

I try to use Hugo Pipelines because a step away to install other packages. So I write what stand in docs but it ends with:

 Error: Error building site: failed to render pages: render of "page" failed: execute of 
 template failed: template: _default/single.html:1:3: executing "_default/single.html" at 
 <partial "layout/head" .>: error calling partial: 
 "/home/siefke/Dokumente/projects/privatesites/sisi- 
 systems.ovh/layouts/partials/layout/head.html:12:18": execute of template failed: template: 
 partials/layout/head.html:12:18: executing "partials/layout/head.html" at <dict "targetPath" 
 "css/layout.css" "outputStyle" "compressed" "enableSourceMap">: error calling dict: invalid 
 dictionary call

In the head.html:

{{ $options := (dict "targetPath" "css/layout.css" "outputStyle" "compressed" 
"enableSourceMap") }}
{{ $style := resources.Get "scss/layout.scss" | resources.ToCSS $options }}

<link rel="stylesheet" href="{{ $style.Permalink }}">

In the static folder find the folder static with content:

ls static/
static/

ls static/static/
css/  fonts/  img/  js/  scss/

Have someone an Idea what is wrong. I try with static, without static but the error is same.

Regards
Silvio

Your dict argument list is odd (not even). dict takes an even number of arg. odds are keys, even are values so reading your dict:

targetPath: "css/layout.css"
outputStyle: "compressed" 
enableSourceMap: ???

You need a value for that enableSourceMap key, I would guess true.

2 Likes