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

render of "term" failed: execute of template failed #84

Closed
agouny opened this issue Jul 19, 2020 · 4 comments
Closed

render of "term" failed: execute of template failed #84

agouny opened this issue Jul 19, 2020 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed no-activity

Comments

@agouny
Copy link

agouny commented Jul 19, 2020

Hi, trying to run this theme and getting the below error when executing "hugo serve" using Hugo 0.74.2:

Building sites … ERROR 2020/07/19 18:47:14 render of "term" failed: execute of template failed: template: _default/list.html:26:74: executing "bottom-menu" at <partial "bottom_menu.html" (dict "Page" . "show_back_menu_item" false)>: error calling partial: "/Users/folder/themes/sam/layouts/partials/bottom_menu.html:1:10": execute of template failed: template: partials/bottom_menu.html:1:10: executing "partials/bottom_menu.html" at <(.Page.Site.Params.mainMenu) (.show_back_menu_item)>: can't give argument to non-function .Page.Site.Params.mainMenu
ERROR 2020/07/19 18:47:14 render of "term" failed: execute of template failed: template: _default/list.html:26:74: executing "bottom-menu" at <partial "bottom_menu.html" (dict "Page" . "show_back_menu_item" false)>: error calling partial: "/Users/folder/themes/sam/layouts/partials/bottom_menu.html:1:10": execute of template failed: template: partials/bottom_menu.html:1:10: executing "partials/bottom_menu.html" at <(.Page.Site.Params.mainMenu) (.show_back_menu_item)>: can't give argument to non-function .Page.Site.Params.mainMenu
ERROR 2020/07/19 18:47:14 render of "term" failed: execute of template failed: template: _default/list.html:26:74: executing "bottom-menu" at <partial "bottom_menu.html" (dict "Page" . "show_back_menu_item" false)>: error calling partial: "/Users/folder/themes/sam/layouts/partials/bottom_menu.html:1:10": execute of template failed: template: partials/bottom_menu.html:1:10: executing "partials/bottom_menu.html" at <(.Page.Site.Params.mainMenu) (.show_back_menu_item)>: can't give argument to non-function .Page.Site.Params.mainMenu
ERROR 2020/07/19 18:47:14 render of "term" failed: execute of template failed: template: _default/list.html:26:74: executing "bottom-menu" at <partial "bottom_menu.html" (dict "Page" . "show_back_menu_item" false)>: error calling partial: "/Users/folder/themes/sam/layouts/partials/bottom_menu.html:1:10": execute of template failed: template: partials/bottom_menu.html:1:10: executing "partials/bottom_menu.html" at <(.Page.Site.Params.mainMenu) (.show_back_menu_item)>: can't give argument to non-function .Page.Site.Params.mainMenu
Built in 14 ms
Error: Error building site: failed to render pages: render of "term" failed: execute of template failed: template: _default/list.html:26:74: executing "bottom-menu" at <partial "bottom_menu.html" (dict "Page" . "show_back_menu_item" false)>: error calling partial: "/Users/folder/themes/sam/layouts/partials/bottom_menu.html:1:10": execute of template failed: template: partials/bottom_menu.html:1:10: executing "partials/bottom_menu.html" at <(.Page.Site.Params.mainMenu) (.show_back_menu_item)>: can't give argument to non-function .Page.Site.Params.mainMenu

Running Hugo Static Site Generator v0.74.2/extended darwin/amd64 BuildDate: unknown on osx.

Cheers!

@victoriadrake
Copy link
Owner

Thanks @agouny! I can't seem to replicate this error, so I'm opening this issue for help. If you have more information to share, or you're willing to open source your site, that might help the diagnostic process.

@victoriadrake victoriadrake added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 19, 2020
@oopschen
Copy link

hugo version:
│╰─ hugo version
│Hugo Static Site Generator v0.74.2-48565DE6 linux/amd64 BuildDate: 2020-07-17T17:25:56Z

Replicate the problem.

### Solution:

Change file layouts/partials/bottom_menu.html line 1
Origin:
{{ if or ((.Page.Site.Params.mainMenu) (.show_back_menu_item)) }}

To:
{{ if or (.Page.Site.Params.mainMenu) (.show_back_menu_item) }}

It seems the go template upgrades, the most outer square make a function call.

@victoriadrake
Copy link
Owner

Thank you @oopschen!

@agouny This was changed in e3f815d#diff-fed0815ec9f8e8bfb810282b95e0f43b. Can you confirm you're running the most current version of the theme?

@github-actions
Copy link

It looks like this has been idle a while, so I am marking it as stale. Remove the label or comment if this issue should remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed no-activity
Projects
None yet
Development

No branches or pull requests

3 participants