dldx / hpstr-hugo-theme

:art: A Hugo theme based on the HPSTR Jekyll theme.

Home Page:https://dldx.github.io/hpstr-hugo-theme/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors on site without expected parameters set

paskal opened this issue · comments

Hello!

$subj, when trying to run this theme against my blog source I get following:

Building sites … ERROR 2018/03/20 14:45:14 Error while rendering "taxonomy" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "head.html" ...>: error calling partial: template: theme/partials/head.html:13:31: executing "theme/partials/head.html" at <index .Site.Data.sec...>: error calling index: index of untyped nil
ERROR 2018/03/20 14:45:14 Error while rendering "taxonomyTerm" in "": template: theme/_default/terms.html:1:3: executing "theme/_default/terms.html" at <partial "head.html" ...>: error calling partial: template: theme/partials/head.html:13:31: executing "theme/partials/head.html" at <index .Site.Data.sec...>: error calling index: index of untyped nil
ERROR 2018/03/20 14:45:14 Error while rendering "section" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "head.html" ...>: error calling partial: template: theme/partials/head.html:13:31: executing "theme/partials/head.html" at <index .Site.Data.sec...>: error calling index: index of untyped nil
ERROR 2018/03/20 14:45:15 Error while rendering "404" in "": template: theme/404.html:1:3: executing "theme/404.html" at <partial "head.html" ...>: error calling partial: template: theme/partials/head.html:13:31: executing "theme/partials/head.html" at <index .Site.Data.sec...>: error calling index: index of untyped nil

Change detected, rebuilding site
2018-03-20 14:46:02.386 +0000
Source changed "/srv/hugo/content/post/2018-03-19-lust-for-text-life.markdown": WRITE
ERROR 2018/03/20 14:46:02 Error while rendering "404" in "": template: theme/404.html:1:3: executing "theme/404.html" at <partial "head.html" ...>: error calling partial: template: theme/partials/head.html:13:31: executing "theme/partials/head.html" at <index .Site.Data.sec...>: error calling index: index of untyped nil
Total in 467 ms

The reason is possibly some absent .Site. parameter but you can't tell it from error message, I guess input parameters handling could be improved.

victoriadrake/hugo-theme-sam#3 is an example of how this can be fixed.

Fixed with commit 8b2714c. I actually just had to copy the data folder over to the themes directory. Thanks for reporting it!