Hugo Errors in single.html

Shu from Guilty Crown

While messing around and fixing up some final things in Hugo earlier, I hit an error message which I was only able to resolve with Ruben’s assistance. Some of Hugo’s error messages are often ambiguous enough to be completely useless and in this case it certainly seemed so.

When I tried to build the site, the following message appeared:

kiri@Takano ~/Documents/kny-hugo$ hugo server
ERROR: 2015/05/10 Error while rendering homepage: template: _default/single.html:13:7: executing "_default/single.html" at <.Content>: Content is not a field of struct type *hugolib.Node

I did not recall changing anything in the single.html file that would cause this issue, not having edited the file since the last build which was successful. A search of the internet turned up nothing significant pertaining to this error message. Either no one had this issue or… something.

As it turns out I had somehow dragged the index.html out of the layouts folder into the root and it was unable to ‘render homepage’ because of that. Because the error message had pointed me to the single.html file though, I’d been running around in that file and my partials files for the better part of half an hour before Ruben - more familiar with the folder structure than I - realised my index file was in the wrong place. Used to Jekyll’s structure of having it in the root, I didn’t take notice of this.

Hugo’s served me pretty well over the last 24 hours, but one thing that seems certain is that everything on the community out there seems a lot more incomprehensible and hard to find, whereas Jekyll’s documentation was simple and there are many posts out there advising on how to achieve specific goals. This seems less of the case with Hugo so far. Still, we’ll trundle on and see how we go.