HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.2k stars 2.9k forks source link

Publication causing "Error building site" #1827

Closed nunesgh closed 4 years ago

nunesgh commented 4 years ago

Describe the bug

After creating a new Publication using the command hugo new --kind publication publication/<publication-name>, the following error started to happen whenever trying to run hugo or hugo server:

$ hugo server Built in 219 ms Error: Error building site: failed to render pages: render of "page" failed: "/\/website/themes/academic/layouts/publication/single.html:14:10": execute of template failed: template: publication/single.html:14:10: executing "main" at <(.Params.publication_types) and (ne (index .Params.publication_types 0) "0")>: can't give argument to non-function .Params.publication_types

Removing the publication/ folder has enabled me to run both hugo and hugo server commands again.

Technical details:

gcushen commented 4 years ago

Duplicate of #1786, #1733, #1722, #1718, #1719, #1715 .

See https://github.com/gcushen/hugo-academic/issues/1786#issuecomment-660947530

nunesgh commented 4 years ago

Thanks, @gcushen!

For those with the same issue, a temporary solution while we wait for version 5.0 of Academic would be:

  1. Copy the file /<path to repository>/website/themes/academic/layouts/publication/single.html;
  2. Paste the new file in /<path to repository>/website/layouts/publication/single.html;
  3. Change line 14 of the new file as done in #1715.

Before updating to version 5.0 of Academic, just delete the folder /<path to repository>/website/layouts/publication/.