Error with template: illegal number syntax: "-"

I’m trying out a theme and when I run hugo server I get this error:

Error: add site dependencies: load resources: loading templates: 
"{my hugo site}/themes/hugo- 
refresh/layouts/partials/css.html:27:1": parse failed: template: partials/css.html:27: 
illegal number syntax: "-"

The file in question has what seems to be valid syntax on line 27 (window included for context):

25	{{- $css  := resources.Get $sass | resources.ExecuteAsTemplate $scss . | toCSS $cssOpts -}}
26	{{- $css1 := resources.Get "css/monokai-sublime.9.15.8.min.css" -}}
27	{{- $css2 := resources.Get "css/icons.css"                      -}}
28	{{- $css3 := resources.Get "css/refresh-css.css"                -}}
29	{{- $css4 := resources.Get "css/devicon.min.css"                -}}

The actual file can be found here.

Any idea what’s going wrong here?


I had a look at the theme you link to. When I test it using the exampleSite it provides, I get no errors. We will need more details to help you figure this out, have a read about Requesting Help for more details.

1 Like

Hmm, I figured out for me at least it was the extra space in the template which caused the error, when that was removed it worked.

1 Like

Hi @willismonroe I have the same problem - which space is it you are removing?

The extra blank spaces within the Hugo template tags.

I see - thanks @willismonroe!