MunifTanjim / minimo

Minimo - Minimalist theme for Hugo
https://minimo.netlify.app
MIT License
545 stars 220 forks source link

Errors on site without expected parameters set #112

Closed paskal closed 6 years ago

paskal commented 6 years ago

Hello!

$subj, when trying to run this theme against my blog source I get following (and site won't render at all):

Building sites … ERROR 2018/03/20 20:36:14 Error while rendering "page" in "": template: theme/_default/single.html:13:3: executing "theme/_default/single.html" at <partial "footer" .>: error calling partial: template: theme/partials/footer.html:5:13: executing "theme/partials/footer.html" at <partial "nav/menus/s...>: error calling partial: template: theme/partials/nav/menus/social.html:2:5: executing "theme/partials/nav/menus/social.html" at <partial "widgets/soc...>: error calling partial: template: theme/partials/widgets/social_menu.html:23:30: executing "theme/partials/widgets/social_menu.html" at <index $social $platf...>: error calling index: index of untyped nil
ERROR 2018/03/20 20:36:14 Error while rendering "page" in "post/": template: theme/_default/single.html:13:3: executing "theme/_default/single.html" at <partial "footer" .>: error calling partial: template: theme/partials/footer.html:5:13: executing "theme/partials/footer.html" at <partial "nav/menus/s...>: error calling partial: template: theme/partials/nav/menus/social.html:2:5: executing "theme/partials/nav/menus/social.html" at <partial "widgets/soc...>: error calling partial: template: theme/partials/widgets/social_menu.html:23:30: executing "theme/partials/widgets/social_menu.html" at <index $social $platf...>: error calling index: index of untyped nil
ERROR 2018/03/20 20:36:14 Error while rendering "taxonomy" in "": template: theme/_default/list.html:21:3: executing "theme/_default/list.html" at <partial "footer" .>: error calling partial: template: theme/partials/footer.html:5:13: executing "theme/partials/footer.html" at <partial "nav/menus/s...>: error calling partial: template: theme/partials/nav/menus/social.html:2:5: executing "theme/partials/nav/menus/social.html" at <partial "widgets/soc...>: error calling partial: template: theme/partials/widgets/social_menu.html:23:30: executing "theme/partials/widgets/social_menu.html" at <index $social $platf...>: error calling index: index of untyped nil
ERROR 2018/03/20 20:36:14 Error while rendering "home" in "": template: theme/index.html:10:11: executing "theme/index.html" at <len .Site.Params.wid...>: error calling len: len of untyped nil
ERROR 2018/03/20 20:36:15 Error while rendering "section" in "": template: theme/_default/list.html:21:3: executing "theme/_default/list.html" at <partial "footer" .>: error calling partial: template: theme/partials/footer.html:5:13: executing "theme/partials/footer.html" at <partial "nav/menus/s...>: error calling partial: template: theme/partials/nav/menus/social.html:2:5: executing "theme/partials/nav/menus/social.html" at <partial "widgets/soc...>: error calling partial: template: theme/partials/widgets/social_menu.html:23:30: executing "theme/partials/widgets/social_menu.html" at <index $social $platf...>: error calling index: index of untyped nil
ERROR 2018/03/20 20:36:15 Error while rendering "taxonomyTerm" in "": template: theme/_default/terms.html:15:3: executing "theme/_default/terms.html" at <partial "footer" .>: error calling partial: template: theme/partials/footer.html:5:13: executing "theme/partials/footer.html" at <partial "nav/menus/s...>: error calling partial: template: theme/partials/nav/menus/social.html:2:5: executing "theme/partials/nav/menus/social.html" at <partial "widgets/soc...>: error calling partial: template: theme/partials/widgets/social_menu.html:23:30: executing "theme/partials/widgets/social_menu.html" at <index $social $platf...>: error calling index: index of untyped nil
ERROR 2018/03/20 20:36:15 Error while rendering "404" in "": template: theme/404.html:26:3: executing "theme/404.html" at <partial "footer" .>: error calling partial: template: theme/partials/footer.html:5:13: executing "theme/partials/footer.html" at <partial "nav/menus/s...>: error calling partial: template: theme/partials/nav/menus/social.html:2:5: executing "theme/partials/nav/menus/social.html" at <partial "widgets/soc...>: error calling partial: template: theme/partials/widgets/social_menu.html:23:30: executing "theme/partials/widgets/social_menu.html" at <index $social $platf...>: error calling index: index of untyped nil

Change detected, rebuilding site
2018-03-20 21:48:59.014 +0000
Source changed "/srv/hugo/content/post/2018-03-19-lust-for-text-life.markdown": WRITE
ERROR 2018/03/20 21:48:59 Error while rendering "page" in "post/": template: theme/_default/single.html:13:3: executing "theme/_default/single.html" at <partial "footer" .>: error calling partial: template: theme/partials/footer.html:5:13: executing "theme/partials/footer.html" at <partial "nav/menus/s...>: error calling partial: template: theme/partials/nav/menus/social.html:2:5: executing "theme/partials/nav/menus/social.html" at <partial "widgets/soc...>: error calling partial: template: theme/partials/widgets/social_menu.html:23:30: executing "theme/partials/widgets/social_menu.html" at <index $social $platf...>: error calling index: index of untyped nil
ERROR 2018/03/20 21:48:59 Error while rendering "home" in "": template: theme/index.html:10:11: executing "theme/index.html" at <len .Site.Params.wid...>: error calling len: len of untyped nil
ERROR 2018/03/20 21:48:59 Error while rendering "404" in "": template: theme/404.html:26:3: executing "theme/404.html" at <partial "footer" .>: error calling partial: template: theme/partials/footer.html:5:13: executing "theme/partials/footer.html" at <partial "nav/menus/s...>: error calling partial: template: theme/partials/nav/menus/social.html:2:5: executing "theme/partials/nav/menus/social.html" at <partial "widgets/soc...>: error calling partial: template: theme/partials/widgets/social_menu.html:23:30: executing "theme/partials/widgets/social_menu.html" at <index $social $platf...>: error calling index: index of untyped nil
Total in 52 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. https://github.com/cboettig/hugo-now-ui/issues/9 might be used as reference point.

Fastidious commented 6 years ago

@paskal did you follow the instructions to install? Save a backup of your config.toml, and use the one inside exampleSite and run hugo serve to see what you get.

paskal commented 6 years ago

I did not follow any instructions, what I'm trying to do is to just render my site with different themes and pick one, without customizing it 204 times. I suggest setting some default values in places there is an error now, so people like me could see their site rendered without playing around with configuration (but with only basic functionality, for example). The linked issue I've mentioned have a pretty good conversation on that matter.

Fastidious commented 6 years ago

@paskal sadly, that is not the way Hugo themes work. That is especially evident for themes that go out of the way to provide extra functionality. Yet, I agree with you, there has to be a way to provide the bare basic standard settings to get a quasi-functional theme working out of the box.

MunifTanjim commented 6 years ago

Pushed 774028d79d8c70f4d99eb5cd9c38464a92ee14fe & 42a7b44e448f2b735feb0329d2ee7747b4e86b5a

Does that improve your situation? @paskal

paskal commented 6 years ago

@paskal sadly, that is not the way Hugo themes work. That is especially evident for themes that go out of the way to provide extra functionality.

@Fastidious, it works the way we want it to work. I've created one hundred issues, with little effort there and there baseline will be set for everyone. @MunifTanjim, it works fine now, not a single error, thank you very much! Resolving, if you don't mind.