Closed bjsmith closed 2 years ago
If you have an old site with the wowchemy/academic theme that used to work, it shouldn't be too hard to make it continue to work. The only thing you need to figure out is which Hugo version you were using at that time. Then pin the Hugo version in .Rprofile
(follow the tips of blogdown::check_site()
). If you don't remember the version now, you may
either view the HTML source of the old site and see if the Hugo version was written there (of the form <meta name="generator" content="Hugo X.Y[.Z]" />
or browse the Hugo releases: https://github.com/gohugoio/hugo/releases and guess the version released at about the same time as when your old site was created.
Then install that version of Hugo with blogdown::install_hugo("THAT_VERSION")
.
I have felt exhausted to keep up with the academic theme. It's constantly changing. If you must use this theme, that's totally fine---just remember to pin the Hugo version, and never upgrade the theme. Alternatively, you may consider the apero theme (https://github.com/hugo-apero/hugo-apero) if you are to create new sites in the future.
Anyway, thanks for the report! I'll see why the academic theme is broken in blogdown again.
Thank you for the tip! I've already upgraded to the latest version of the theme to try to address the issue but it doesn't seem to help. I'll try another theme later today and see if it makes a difference.
Just a note to say the problem really is with the theme (as you seem to believe already). I tried blogdown::new_site(theme="hugo-apero/hugo-apero")
and that created a functional site.
Thank you yihui! Your tip on hugo releases was what I needed to fix my site. The theme was downloaded ~Sep 2017, and after I installed the corresponding hugo version, 0.27, and pointed to it using the .Rprofile file, it all compiles nicely.
In case it helps, after having installed hugo 0.98 instead of running in 0.74 as previously, I'm getting different errors. From an empty working directory:
> blogdown::new_site(theme = "wowchemy/starter-hugo-academic")
― Creating your new site
► The directory '.' is not empty. Create the site anyway? (y/n) y
| Installing the theme wowchemy/starter-hugo-academic from github.com
trying URL 'https://github.com/wowchemy/starter-hugo-academic/archive/main.tar.gz'
downloaded 1.8 MB
| Adding the sample post to content/post/2020-12-01-r-rmarkdown/index.Rmd
| Converting all metadata to the YAML format
Error: module "github.com/wowchemy/wowchemy-hugo-modules/wowchemy/v5" not found; either add it as a Hugo Module or store it in "/Users/benjaminsmith/Google Drive/website/www_test4/themes".: module does not exist
| Adding netlify.toml in case you want to deploy the site to Netlify
| Adding .Rprofile to set options() for blogdown
― The new site is ready
○ To start a local preview: use blogdown::serve_site(), or the RStudio add-in "Serve Site"
○ To stop a local preview: use blogdown::stop_server(), or restart your R session
► Want to serve and preview the site now? (y/n) y
Launching the server via the command:
/Users/benjaminsmith/Library/Application Support/Hugo/0.98.0/hugo server --bind 127.0.0.1 -p 4321 --themesDir themes -t starter-hugo-academic -D -F --navigateToChanged
Error: module "github.com/wowchemy/wowchemy-hugo-modules/wowchemy/v5" not found; either add it as a Hugo Module or store it in "/Users/benjaminsmith/Google Drive/website/www_test4/themes".: module does not exist
In any case, I'm just happy to have my old site running in the old version. I'd be happy to close the issue but perhaps you want to deal with it anyway, so I'll leave it for you to decide.
Error: module "github.com/wowchemy/wowchemy-hugo-modules/wowchemy/v5" not found; either add it as a Hugo Module or store it in "/Users/benjaminsmith/Google Drive/website/www_test4/themes".: module does not exist
I've been investigating this problem in the past few hours. I'll close this issue once I figure out a fix.
after I installed the corresponding hugo version, 0.27, and pointed to it using the .Rprofile file, it all compiles nicely
Great! That's what I expected. Thanks for letting me know!
@bjsmith It was not easy to figure out the fix, but I made it anyway. The academic theme should work with blogdown again (although not recommended).
@cderv When you have time, could you add a daily Github action workflow to test a few themes? Currently I'm thinking of these themes but may add more later:
themes = c(
'hugo-apero/hugo-apero',
'wowchemy/starter-hugo-academic',
'wowchemy/starter-research-group',
'yihui/hugo-prose'
)
for (theme in themes) {
d = tempfile()
dir.create(d)
xfun::in_dir(d, {
blogdown::new_site(theme = theme, serve = FALSE)
blogdown::build_site(build_rmd = 'newfile')
})
unlink(d, recursive = TRUE)
}
With this workflow, we will know sooner if a theme is broken again in the future (especially the academic theme). Thanks!
nice work! I will stick with my existing older version of the academic theme and consider a different theme entirely next time I do a full overhaul.
Also, lovely to virtually meet you after all this time enjoying your blogdown content. Your book on it is wonderfully clear and straightforward. This is not the only website I have running on blogdown. Appreciate all your work!
Thanks for the kind words! It's my great pleasure!
Yes, for older sites with the academic theme, they should continue to work perfectly fine for the years to come, as long as you fix the Hugo version.
I am attempting to serve a blogdown website. It's an old one that used to work, but it doesn't now. Specifically, serve_site() runs without an error, but the compiled page, viewable in the browser on the View panel, contains no content.
In order to isolate the problem I have created a minimal example. I followed the guide at https://www.apreshill.com/blog/2020-12-new-year-new-blogdown/ to create a brand new website. I created a new R project in a blank directory, then ran the following code:
Following this, in RStudio, the View Panel activates, but its contents is blank. Using my browser to browse to
http://localhost:4321
, the contents are blank. Using "inspect source" in-browser, I see the source is:The output in the R console is:
I wondered if it could be an RStudio View Panel problem. I dont' think so, because the problem affects in-browser view as well, but just in case, I tried:
This correctly renders a plot with 3 data points on it in the View Panel.
I ran the following commands trying to see if anything made a difference, but the results were more or less the same:
check_site
gives the following output:And then
session_info
:Any idea what could be going wrong?