rstudio / blogdown

Create Blogs and Websites with R Markdown
https://pkgs.rstudio.com/blogdown/
1.73k stars 334 forks source link

Build site with updated Hugo #758

Closed chenchenzi closed 10 months ago

chenchenzi commented 10 months ago

Hi,

I built a wesbite a couple years ago and it was with hugo version 0.69.0, Netlify, R, and Rstudio. Now that I switched to a new working laptop (Mac M2) and the Hugo I installed is now 0.121.1 (R version: 4.3.2; blogdown version: 1.18). I am wondering how to build or configure my website using the upgraded hugo? Or should I reinstall the much older Hugo?

Error: Found 'hugo' at '/opt/homebrew/bin/hugo' but its version is 0.121.1 instead of the requested version 0.69.0. You may try blogdown::install_hugo("0.69.0").

Also when I tried to install hugh 0.69.0 via blogdown, I got another error message:

Failed to download hugo_extended_0.69.0_macOS-ARM64.tar.gz from https://github.com/gohugoio/hugo/releases/tag/v0.69.0.

When I attempted to edit the Hugo version in .Rprofile and netlify.toml to match the Hugo I installed (0.121.1), I got the following error message when I did blogdown::serve_site():

Launching the server via the command:
  hugo server --bind 127.0.0.1 -p 4321 --themesDir themes --theme hugo-academic -D -F --navigateToChanged
sh: line 0: kill: (7607) - No such process
Error: It took more than 30 seconds to launch the server. An error might have occurred with hugo. You may run blogdown::build_site() and see if it gives more info.

Could anyone please help with this? Thank you very much!

Checklist

When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:

yihui commented 10 months ago

Hugo 0.69.0 doesn't have an ARM64 version:

blogdown::hugo_installers('0.69.0')
version os arch extended
hugo_0.69.0_DragonFlyBSD-64bit.tar.gz 0.69.0 DragonFlyBSD 64bit FALSE
hugo_0.69.0_FreeBSD-32bit.tar.gz 0.69.0 FreeBSD 32bit FALSE
hugo_0.69.0_FreeBSD-64bit.tar.gz 0.69.0 FreeBSD 64bit FALSE
hugo_0.69.0_FreeBSD-ARM.tar.gz 0.69.0 FreeBSD ARM FALSE
hugo_0.69.0_Linux-32bit.tar.gz 0.69.0 Linux 32bit FALSE
hugo_0.69.0_Linux-64bit.tar.gz 0.69.0 Linux 64bit FALSE
hugo_0.69.0_Linux-ARM.tar.gz 0.69.0 Linux ARM FALSE
hugo_0.69.0_Linux-ARM64.tar.gz 0.69.0 Linux ARM64 FALSE
hugo_0.69.0_macOS-32bit.tar.gz 0.69.0 macOS 32bit FALSE
hugo_0.69.0_macOS-64bit.tar.gz 0.69.0 macOS 64bit FALSE
hugo_0.69.0_NetBSD-32bit.tar.gz 0.69.0 NetBSD 32bit FALSE
hugo_0.69.0_NetBSD-64bit.tar.gz 0.69.0 NetBSD 64bit FALSE
hugo_0.69.0_NetBSD-ARM.tar.gz 0.69.0 NetBSD ARM FALSE
hugo_0.69.0_OpenBSD-32bit.tar.gz 0.69.0 OpenBSD 32bit FALSE
hugo_0.69.0_OpenBSD-64bit.tar.gz 0.69.0 OpenBSD 64bit FALSE
hugo_0.69.0_OpenBSD-ARM.tar.gz 0.69.0 OpenBSD ARM FALSE
hugo_0.69.0_Windows-32bit.zip 0.69.0 Windows 32bit FALSE
hugo_0.69.0_Windows-64bit.zip 0.69.0 Windows 64bit FALSE
hugo_extended_0.69.0_Linux-64bit.tar.gz 0.69.0 Linux 64bit TRUE
hugo_extended_0.69.0_macOS-64bit.tar.gz 0.69.0 macOS 64bit TRUE
hugo_extended_0.69.0_Windows-64bit.zip 0.69.0 Windows 64bit TRUE

If you want to continue to use 0.69.0, you can try the 64bit version:

blogdown::install_hugo('0.69.0', arch = '64bit')

If you want to use a newer version, you can install it with blogdown::install_hugo(). Then search for 0.69.0 in your website project (e.g., Cmd + Shift + F in RStudio) and replace with the new version. Restart R and serve the site. It seems you are using the Hugo Academic theme. If that's true, you might have trouble if you use a newer version of Hugo for your old website. You can try, though. If 0.69.0 worked fine in the past, it's probably a good idea to stick to it.

chenchenzi commented 10 months ago

Thank you @yihui for your quick reply. Yes I am using Hugo Academic theme, and it seeems that the newer version of Hugo (0.121.1) doesn't work. Followed your advice, I installed hugo '0.69.0' with '64bit', and now serve_site() works! Thank you very much!

RobWiederstein commented 1 month ago

Same scenario in that I switched to a new laptop. Just had to add the arch = 64bit and everything worked fine.