Site does not build with recent hugo

Moved from GitHub tutorial/23

Posted by kortschak:

The README says that the tutorial is tested with hugo v0.19, but the current master of hugo is v0.28. Maintaining an old instance of hugo is difficult because its dependencies have shifted.

The current version of hugo will not build the tutorial:

~/dgraph/tutorial [master]$ hugo version
Hugo Static Site Generator v0.28-DEV linux/amd64 BuildDate: 2017-09-22T19:13:37+09:30
~/dgraph/tutorial [master]$ hugo -w server
Started building sites ...
ERROR 2018/03/30 21:12:13 Error while rendering "page": template: theme/_default/single.html:8:3: executing "theme/_default/single.html" at <partial "sidebar.htm...>: error calling partial: template: theme/partials/sidebar.html:13:31: executing "theme/partials/sidebar.html" at <index $sections .Ide...>: error calling index: cannot index slice/array with type string
ERROR 2018/03/30 21:12:13 Error while rendering "home": template: theme/_default/list.html:4:3: executing "theme/_default/list.html" at <partial "sidebar.htm...>: error calling partial: template: theme/partials/sidebar.html:13:31: executing "theme/partials/sidebar.html" at <index $sections .Ide...>: error calling index: cannot index slice/array with type string
ERROR 2018/03/30 21:12:13 Error while rendering "section": template: theme/_default/section.html:4:3: executing "theme/_default/section.html" at <partial "sidebar.htm...>: error calling partial: template: theme/partials/sidebar.html:13:31: executing "theme/partials/sidebar.html" at <index $sections .Ide...>: error calling index: cannot index slice/array with type string
WARNING: calling IsSet with unsupported type "invalid" (<nil>) will always return false.

This appears to have happened in v0.23 (deprecation in v0.22):

Started building sites ...
ERROR 2018/03/30 21:24:45 Site's Sections is deprecated and will be removed in Hugo 0.23. In Hugo 0.22 we introduced nested sections, so this method now returns an empty taxonomy.
	
To list sections with its pages, you can do something like this:

{{ range $.Site.Home.Sections }}
  Section: {{ .Title }}
  {{ range .Pages }}
     Section Page: {{ .Title }}
  {{ end }}
{{ end }}

To get a specific section, you can do this:

{{ $section := $.Site.GetPage "section" "blog" }}
.
WARNING: calling IsSet with unsupported type "invalid" (<nil>) will always return false.

pawanrawal commented :

Thanks for the information @kortschak. I have merged a fix with e2d2f4d081ff7236fc603f05a191280cce5f8598.

kortschak commented :

Thanks