Blogdown build_site() and serve_site() not functioning

I have been updating my personal website and trying other themes/project types for varfious portfolios. Not sure what happened exactly, but now every time I run build_site() or serve_site() I get the following errors,l respectively:

build_site():

blogdown::build_site()
Start building sites …
hugo v0.94.1-0FCD9A5D+extended darwin/amd64 BuildDate=2022-03-11T13:53:32Z VendorInfo=gohugoio
WARN 2022/03/11 15:45:45 .Path when the page is backed by a file is deprecated and will be removed in a future release. We plan to use Path for a canonical source path and you probably want to check the source is a file. To get the current behaviour, you can use a construct similar to the one below:

{{ $path := "" }}
{{ with .File }}
{{ $path = .Path }}
{{ else }}
{{ $path = .Path }}
{{ end }}

Re-run Hugo with the flag --panicOnWarning to get a better error message.
ERROR 2022/03/11 15:45:46 render of "page" failed: "/Users/saraandchris/Desktop/CJSchmankWebsite/themes/hugo-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
ERROR 2022/03/11 15:45:46 render of "page" failed: "/Users/saraandchris/Desktop/CJSchmankWebsite/themes/hugo-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
ERROR 2022/03/11 15:45:46 render of "page" failed: "/Users/saraandchris/Desktop/CJSchmankWebsite/themes/hugo-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
ERROR 2022/03/11 15:45:46 render of "page" failed: "/Users/saraandchris/Desktop/CJSchmankWebsite/themes/hugo-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
Total in 348 ms
Error: Error building site: failed to render pages: render of "page" failed: "/Users/saraandchris/Desktop/CJSchmankWebsite/themes/hugo-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

serve_site()

Launching the server via the command:
/Users/saraandchris/Library/Application Support/Hugo/0.94.1/hugo server --bind 127.0.0.1 -p 4321 --themesDir themes -t hugo-academic -D -F --navigateToChanged
Error: Error building site: failed to render pages: render of "page" failed: "/Users/saraandchris/Desktop/CJSchmankWebsite/themes/hugo-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

This could be due to Hugo updates that are not compatible with your current version of the theme you are using.
Did you upgrade Hugo recently ?

Since v1.0 blogdown has a mechanism to pin a Hugo version so that this kind of change in Hugo does not impact a blog.

Hello cderv, Thank you for your response!

I did update Hugo! I want to say that the issues began shortly after updating. I sure would like to go back! Do you have any idea how I could install a version of Hugo that would work with blogdown and Rstudio?

Please do read the link above to see how to manage Hugo version for your project.

blogdown::install_hugo() will allow you to install a specific version

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.