Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on site without expected parameters set #12

Closed
paskal opened this issue Mar 20, 2018 · 1 comment
Closed

Errors on site without expected parameters set #12

paskal opened this issue Mar 20, 2018 · 1 comment

Comments

@paskal
Copy link
Contributor

paskal commented Mar 20, 2018

Hello!

$subj, when trying to run this theme against my blog source I get following (and nothing renders):

Building sites … WARNING: calling IsSet with unsupported type "ptr" (*hugolib.PageOutput) will always return false.

ERROR 2018/03/20 14:45:42 Error while rendering "page" in "": template: theme/_default/single.html:1:3: executing "theme/_default/single.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string
ERROR 2018/03/20 14:45:42 Error while rendering "page" in "post/": template: theme/_default/single.html:1:3: executing "theme/_default/single.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string
ERROR 2018/03/20 14:45:42 Error while rendering "taxonomy" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string
ERROR 2018/03/20 14:45:42 Error while rendering "home" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string
ERROR 2018/03/20 14:45:42 Error while rendering "section" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string
ERROR 2018/03/20 14:45:42 Error while rendering "taxonomyTerm" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string
ERROR 2018/03/20 14:45:42 Error while rendering "404" in "": template: theme/404.html:1:3: executing "theme/404.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string

Change detected, rebuilding site
2018-03-20 14:46:02.263 +0000
Source changed "/srv/hugo/content/post/2018-03-19-lust-for-text-life.markdown": WRITE
WARNING: calling IsSet with unsupported type "ptr" (*hugolib.PageOutput) will always return false.

ERROR 2018/03/20 14:46:02 Error while rendering "page" in "post/": template: theme/_default/single.html:1:3: executing "theme/_default/single.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string
ERROR 2018/03/20 14:46:02 Error while rendering "home" in "": template: theme/_default/list.html:1:3: executing "theme/_default/list.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string
ERROR 2018/03/20 14:46:02 Error while rendering "404" in "": template: theme/404.html:1:3: executing "theme/404.html" at <partial "top.html" .>: error calling partial: template: theme/partials/top.html:9:7: executing "theme/partials/top.html" at <partial "menu.html" ...>: error calling partial: template: theme/partials/menu.html:2:101: executing "theme/partials/menu.html" at <index $.Site.Data.tr...>: error calling index: value is nil; should be of type string
Total in 215 ms

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

@paskal
Copy link
Contributor Author

paskal commented Mar 24, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant