I am having compilation of my site failing with the following error:
Hugo Error
ERROR 2020/12/03 20:48:10 Process: loading templates: “/home/patrick/Projects/Hugo/dnb-hugo/search-algolia/layouts/_internal/algolia-setup.html:1:1”: parse failed: template: _internal/algolia-setup.html:1: bad character U+002D ‘-’
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func2
/root/project/hugo/hugolib/hugo_sites_build.go:120
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func3
/root/project/hugo/hugolib/hugo_sites_build.go:135
runtime/trace.WithRegion
/usr/local/go/src/runtime/trace/annotation.go:137
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build
/root/project/hugo/hugolib/hugo_sites_build.go:137
github.com/gohugoio/hugo/commands.(*commandeer).rebuildSites
/root/project/hugo/commands/hugo.go:768
github.com/gohugoio/hugo/commands.(*commandeer).handleEvents
/root/project/hugo/commands/hugo.go:1135
github.com/gohugoio/hugo/commands.(*commandeer).newWatcher.func1
/root/project/hugo/commands/hugo.go:875
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1374
The layout in question has the following line in line 1:
{{- with $.Site.Data.dnb.search-algolia.configuration.appId -}}
When I range through $.Site.Data.dnb
and then call later on deeper .configuration
and so on no error comes up. But having the dashed directory name directly in my $.Site.Data call leads to error.
Is this a bug or one of these things that “just” don’t work due to the way upstream libraries work? Maybe there is a way to “mask” the dash, like the backslash in regex formats masks characters with “features”?