Trouble adding Experinces section to Toha

Hello! For a while I’ve had a portfolio site using the theme Toha. I now want to add in the ‘experiences’ section of it back, which I didn’t previously need to. As described in the documentation, I add in experiences.yaml with more or less it’s default info and run it locally. I get the following error though (with file names shortened for this post)

Error: error building site: render: failed to render pages: render of "home" failed: "/.../hugo/portfolio/themes/toha/layouts/index.html:57:18": execute of template failed: template: index.html:57:18: executing "index.html" at <partial (printf "sections/%s.html" (replace (lower .section.id) " " "-")) .>: error calling partial: "/.../hugo/portfolio/themes/toha/layouts/partials/sections/experiences.html:21:12": execute of template failed: template: partials/sections/experiences.html:21:12: executing "partials/sections/experiences.html" at <partial "sections/experiences/experience-info.html" $experience>: error calling partial: "/.../hugo/portfolio/themes/toha/layouts/partials/sections/experiences/experience-info.html:1:10": execute of template failed: template: partials/sections/experiences/experience-info.html:1:10: executing "partials/sections/experiences/experience-info.html" at <len .positions>: error calling len: reflect: call of reflect.Value.Type on zero Value

The experince-info.html in question only looks like this

{{ if gt (len .positions) 1 }}
  {{ partial "sections/experiences/multiple-positions.html" . }}
{{ else }}
  {{ partial "sections/experiences/single-position.html" . }}
{{ end }}

I’ve not done much at all to mess with the site’s theming and nothing I can remember that would break this. I have, however, since moved to linux from windows since I last used this, in case that’s done anything. It still works fine without the new experiences section though.

Any help would be appreciated. Web dev is not my area of programming so I’m not really sure what to look for with this.

Best if you ask the theme author

I did some digging into their issues page and found someone with the same issue. From there I was able to understand it enough to get it working. The website guide misses the ‘positions’ tag. Thank you!

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