When running our build using Travis, we run into this error:
$ hugo --cleanDestinationDir
Started building sites …
ERROR 2017/03/28 21:04:52 .Render only available for regular pages, not for of kind “home”. You probably meant .Site.RegularPages and not.Site.Pages.
Built site for language en:
The build works fine locally. It was also working fine on Friday (4 days) ago. Nothing had changed with our site, but the error started occurring. I am wondering if it is related to this commit, which happened 2 days ago:
Thank you for the prompt reply. I have two follow up questions:
Why is it throwing an error on Travis but not locally? I’ve updated my local Hugo to: Hugo Static Site Generator v0.19 darwin/amd64 BuildDate: 2017-02-27T03:21:29-07:00
We only had one spot where we called .Site.Pages. We fixed that and still got the error. Here is our layouts/index.html template, which calls .Render “content-single” (should be unrelated?):
Note that the .Render method was created before we merged Node and Page and … everything got to be a page. And I kind of forgot about it; the old regular pages works a little bit special in the template/layout department, which .Render hooks into. I will fix that, but not right now.
So, if that is your entire layouts/index.html, it doesn’t make sense as a home page template.
The
{{ .Render "content-single" }}
Is even saying “single”, which is a little misldeading for a Home page. But that will with Hugo 0.20 only render blank, with a WARNING in the log. A partial may be better in this case, not sure.