Changing Site.Data to hugo.Data

I have a partial file that uses ‘.Site.Data.hero‘ but now getting an warning, while the output works:

WARN deprecated: .Site.Data was deprecated in Hugo v0.156.0 and will be removed in a future release. Use hugo.Data instead.

if I change it to .hugo.Data.hero I get the following error.

ERROR error building site: render: [en v1.0.0 guest] failed to render pages: render of “C:/Users/dave/source/repos/nxtsoftnl/widget-website/nxtsoft-widgets/content/_index.md” failed: “C:\Users\dave\source\repos\nxtsoftnl\widget-website\nxtsoft-widgets\layouts\index.html:3:3”: execute of template failed: template: index.html:3:3: executing “main” at <partial “hero.html” .>: error calling partial: “C:\Users\dave\source\repos\nxtsoftnl\widget-website\nxtsoft-widgets\layouts_partials\hero.html:2:15”: execute of template failed: template: _partials/hero.html:2:15: executing “_partials/hero.html” at <.hugo.Data.hero>: can’t evaluate field hugo in type *hugolib.pageState

help?

Remove the dot.

2 Likes

thanks

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.