I’m building a new template, and when I’m trying to build I’m gettings this nasty error:
Building sites … ERROR 2018/06/05 03:37:29 Error while rendering "taxonomy" in "": template: theme/_default/list.html:39:18: executing "theme/_default/list.html" at <after 1 .Data.Pages....>: error calling after: no items left
ERROR 2018/06/05 03:37:29 Error while rendering "home" in "": template: theme/_default/list.html:39:18: executing "theme/_default/list.html" at <after 1 .Data.Pages....>: error calling after: no items left
ERROR 2018/06/05 03:37:29 Error while rendering "taxonomyTerm" in "": template: theme/_default/list.html:39:18: executing "theme/_default/list.html" at <after 1 .Data.Pages....>: error calling after: no items left
ERROR 2018/06/05 03:37:29 Error while rendering "section" in "": template: theme/_default/list.html:39:18: executing "theme/_default/list.html" at <after 1 .Data.Pages....>: error calling after: no items left
Total in 439 ms
Error: Error building site: logged 4 error(s)
This is the 39th line on list.html which is causing error:
{{ range first 30 (after 1 .Data.Pages.ByPublishDate.Reverse) }}
Interesting enough, if I remove after 1
making it
{{ range first 30 (.Data.Pages.ByPublishDate.Reverse) }}
Everything builds!
Building sites …
| EN
+------------------+-----+
Pages | 21
Paginator pages | 0
Non-page files | 0
Static files | 105
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Total in 164 ms
No matter what, I couldn’t figure it out why it has problems with after 1
.
Any help would be appreciated.
Version Details:
Hugo Static Site Generator v0.41 windows/amd64 BuildDate: 2018-05-25T16:57:53Z
GOOS=“windows”
GOARCH=“amd64”
GOVERSION=“go1.10.1”
Update 2:
Another very interesting observation:
1- Remove the after 1
making it
{{ range first 30 (.Data.Pages.ByPublishDate.Reverse) }}
Now I build with --watch switch.
Then as hugo is watching, I simply add the remove part, after 1
, again.
hugo automatically picks up the change and everything builds correctly!
Can’t understand why.