devcows / hugo-universal-theme

Universal theme for Hugo, it stands out with its clean design and elegant typography.
https://devcows.github.io/hugo-universal-theme
MIT License
787 stars 557 forks source link

Simplistic test project fails to build #197

Open prokoudine opened 5 years ago

prokoudine commented 5 years ago

Hello. I followed the official quick start tutorial (init a new site, grab a theme, create a new post, launch). Results:

$ hugo server -D
Building sites … ERROR 2019/02/11 03:53:09 Error while rendering "page" in "posts/2018/gimp-2-10-6/": template: _default/single.html:27:195: executing "_default/single.html" at <.Site.Params.date_fo...>: invalid value; expected string
WARNING: calling IsSet with unsupported type "invalid" (<nil>) will always return false.

Total in 43 ms
Error: Error building site: logged 1 error(s)

When I switch to Ananke or OnePress, the test site builds as expected.

$ hugo version
Hugo Static Site Generator v0.47.1/extended linux/amd64 BuildDate: 2018-09-25T03:41:10Z
prokoudine commented 5 years ago

Oh, and I get the same error on Hugo extended 0.54.

GeorgeWL commented 5 years ago

You're missing site.params.date_format

executing "_default/single.html" at <.Site.Params.date_fo...>: invalid value; expected string

Tbh though we could do with changing it to do a conditional with a default of ISO format, cause it seems that should be a param that has a default fallback.

The problem line is:

https://github.com/devcows/hugo-universal-theme/blob/master/layouts/_default/single.html#L27

which refrences back to the https://github.com/devcows/hugo-universal-theme/blob/master/exampleSite/config.toml (yours will be in the base directory of where you ran from.)

prokoudine commented 5 years ago

Okay, thank you, please let me know when it's time to test changes from the dedicated branch :)

GeorgeWL commented 5 years ago

https://github.com/devcows/hugo-universal-theme/pull/198 @prokoudine

prokoudine commented 5 years ago
$ hugo server -D
ERROR 2019/02/14 02:00:21 Failed to add template "partials/recent_posts.html" in path "partials/recent_posts.html": template: partials/recent_posts.html:45: non executable command in pipeline stage 2
ERROR 2019/02/14 02:00:21 Failed to add template "_default/list.html" in path "_default/list.html": template: _default/list.html:55: non executable command in pipeline stage 2
ERROR 2019/02/14 02:00:21 Failed to add template "_default/single.html" in path "_default/single.html": template: _default/single.html:27: non executable command in pipeline stage 2
ERROR 2019/02/14 02:00:21 partials/recent_posts.html : template: partials/recent_posts.html:45: non executable command in pipeline stage 2
ERROR 2019/02/14 02:00:21 _default/list.html : template: _default/list.html:55: non executable command in pipeline stage 2
ERROR 2019/02/14 02:00:21 _default/single.html : template: _default/single.html:27: non executable command in pipeline stage 2
Building sites … ERROR 2019/02/14 02:00:21 Error while rendering "page" in "posts/2018/gimp-2-10-6/": template: "_default/single.html" is an incomplete or empty template
ERROR 2019/02/14 02:00:21 Error while rendering "section" in "": template: "_default/list.html" is an incomplete or empty template
ERROR 2019/02/14 02:00:21 Error while rendering "taxonomyTerm" in "": template: "_default/list.html" is an incomplete or empty template
ERROR 2019/02/14 02:00:21 Error while rendering "home" in "": template: index.html:26:11: executing "index.html" at <partial "recent_post...>: error calling partial: template: "partials/recent_posts.html" is an incomplete or empty template
Total in 41 ms
Error: Error building site: logged 10 error(s)