okkur / syna

Highly customizable open source theme for Hugo based static websites
https://syna.okkur.org/demo/
Apache License 2.0
250 stars 134 forks source link

Theme fails to build in hugo version 0.71.1 (0.71.0 works fine) #773

Closed Houndie closed 4 years ago

Houndie commented 4 years ago

Is this a BUG REPORT or FEATURE REQUEST?: bug

What happened: Attempting to build site with syna theme with hugo v0.71.1 results in error message:

Error: Error building site: failed to render pages: render of "page" failed: "/path/to/project/themes/syna/layouts/_default/baseof.html:10:9": execute of template failed: template: _default/single.html:10:7: executing "_default/single.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: "/path/to/project/themes/syna/layouts/partials/helpers/fragments-renderer.html:10:9": execute of template failed: template: partials/helpers/fragments-renderer.html:10:9: executing "partials/helpers/fragments-renderer.html" at <(not (isset .Params "slot")) (ne .Params.slot "")>: can't give argument to non-function not (isset .Params "slot")

What you expected to happen: Site builds correctly

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?: Works fine with hugo v0.71.0. Unsure if this is syna doing something it shouldn't or this is a regression on hugo's side. Scanning through the code in the latest changelog, and looking at the error message, it seems like it's related to these changes. (that link may not link correctly due to github not wanting to render the diff by default, look for file " tpl/internal/go_templates/texttemplate/funcs.go")

Probably going to open an issue with hugo as well given that it seems like a regression on their side.

Environment:

stp-ip commented 4 years ago

Thanks for catching this. As mentioned this feels like a regression from a first look especially during a Hugo patch release. Let's wait for a response from Hugo and happy to dive into any possible fixes once we know more.

Houndie commented 4 years ago

According to the hugo devs, hugo 0.71.1 now catches a construct that always "illegal" but was let slide. I submitted a PR above that fixes the offending template.