yursan9/manis-hugo-theme

Errors on site without expected parameters set

Closed this issue · 6 comments

Hello!

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

Building sites … ERROR 2018/03/20 20:36:09 Error while rendering "page" in "post/": template: theme/_default/single.html:3:12: executing "theme/_default/single.html" at <partial "title" .>: error calling partial: template: theme/partials/title.html:13:50: executing "theme/partials/title.html" at <.Site.Params.datefmt>: invalid value; expected string
ERROR 2018/03/20 20:36:09 Error while rendering "page" in "": template: theme/_default/single.html:3:12: executing "theme/_default/single.html" at <partial "title" .>: error calling partial: template: theme/partials/title.html:13:50: executing "theme/partials/title.html" at <.Site.Params.datefmt>: invalid value; expected string
ERROR 2018/03/20 20:36:10 Error while rendering "taxonomy" in "": template: theme/_default/list.html:9:8: executing "theme/_default/list.html" at <partial "li" .>: error calling partial: template: theme/partials/li.html:2:55: executing "theme/partials/li.html" at <.Site.Params.datefmt>: invalid value; expected string
ERROR 2018/03/20 20:36:11 Error while rendering "section" in "": template: theme/_default/list.html:9:8: executing "theme/_default/list.html" at <partial "li" .>: error calling partial: template: theme/partials/li.html:2:55: executing "theme/partials/li.html" at <.Site.Params.datefmt>: invalid value; expected string
ERROR 2018/03/20 20:36:11 Error while rendering "404" in "": template: theme/404.html:7:33: executing "theme/404.html" at <safeHTML>: wrong number of args for safeHTML: want 1 got 0

Change detected, rebuilding site
2018-03-20 21:10:53.151 +0000
Source changed "/srv/hugo/content/post/2018-03-19-lust-for-text-life.markdown": WRITE
ERROR 2018/03/20 21:10:53 Error while rendering "page" in "post/": template: theme/_default/single.html:3:12: executing "theme/_default/single.html" at <partial "title" .>: error calling partial: template: theme/partials/title.html:13:50: executing "theme/partials/title.html" at <.Site.Params.datefmt>: invalid value; expected string
ERROR 2018/03/20 21:10:53 Error while rendering "404" in "": template: theme/404.html:7:33: executing "theme/404.html" at <safeHTML>: wrong number of args for safeHTML: want 1 got 0
Total in 464 ms

The reason is absent .Site.datefmt parameter but you can't tell what's exactly wrong, I guess input parameters handling could be improved (default should be set). cboettig/hugo-now-ui#9 might be used as reference point.

Thank you for the bug report!

I'll take a look at this, and the referenced issue.

Can you try again @paskal? I have push a new commit c11fc5d to fix this.

No errors, main page have no posts, but /post/ show post folder content and single posts are rendered correctly — that's good enough for site I've didn't look into README to configure.
Theme is really nice, I'll consider it as a candidate for my blog. Thank you very much! Resolving.

With pleasure! I want to see your blog if you choose my theme later!

I guess you'll know by new 10 issues and PR which I will create:) By the way, really nice approach in setting defaults — I'll use it as an example for authors who have same problem with their themes.

I'm not sure github sent notifications to mentioned authors, so posting double there: theme highlight is out, this very theme is in it, additional info on https://github.com/paskal/terrty/issues/1.