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

Problem with blogdown::new_site using starter-hugo-academic #638

Closed
3 tasks done
juniperover opened this issue Jul 4, 2021 · 14 comments
Closed
3 tasks done

Problem with blogdown::new_site using starter-hugo-academic #638

juniperover opened this issue Jul 4, 2021 · 14 comments
Labels
bug an unexpected problem or unintended behavior next to consider for next release

Comments

@juniperover
Copy link

juniperover commented Jul 4, 2021

I have posted this issue at the Hugo community here: HugoBlox/hugo-blox-builder#2368 (comment)

I'm trying to use blogdown (v. 1.3.2) in RStudio (v. 1.4.1717/R version 4.1.0) on Mac Big Sur.

When invoking the new_site command, I get the following error message:

> new_site(theme = "wowchemy/starter-hugo-academic")

― Creating your new site
| Installing the theme wowchemy/starter-hugo-academic from github.com
trying URL 'https://github.com/wowchemy/starter-hugo-academic/archive/master.tar.gz'
downloaded 7.1 MB

trying URL 'https://github.com/wowchemy/wowchemy-hugo-modules/archive/v5.3.0.tar.gz'
downloaded 504 KB

Error: module "github.com/wowchemy/wowchemy-hugo-modules/wowchemy/v5" not found; either add it as a Hugo Module or store it in "/Users/[path-info]/themes".: module does not exist
Error in new_content(f2, open = FALSE) : 
  Failed to create the file 'post/2020-12-01-r-rmarkdown/index.en.Rmd'.
In addition: Warning message:
In system2(find_hugo(), ...) :
  running command ''/Users/[path]/Library/Application Support/Hugo/0.84.4/hugo' new 'post/2020-12-01-r-rmarkdown/index.en.md' --themesDir themes -t starter-hugo-academic' had status 255
> 

It appears that the site contents have been moved around so that a path is broken? Any advice or hope for a fix? TIA.

Here's the requested session info:

R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.4, RStudio 1.4.1717

Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8

Package version:
  base64enc_0.1.3   blogdown_1.3.2    bookdown_0.22     digest_0.6.27     evaluate_0.14    
  glue_1.4.2        graphics_4.1.0    grDevices_4.1.0   highr_0.9         htmltools_0.5.1.1
  httpuv_1.6.1      jsonlite_1.7.2    knitr_1.33        later_1.2.0       magrittr_2.0.1   
  markdown_1.1      methods_4.1.0     mime_0.11         promises_1.2.0.1  R6_2.5.0         
  Rcpp_1.0.6        rlang_0.4.11      rmarkdown_2.9     servr_0.22        stats_4.1.0      
  stringi_1.6.2     stringr_1.4.0     tinytex_0.32      tools_4.1.0       utils_4.1.0      
  xfun_0.24         yaml_2.2.1       

Hugo version: 0.84.4

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:

  • [x ] formatted your issue so it is easier for us to read?

  • used blogdown::check_site() function to diagnose your site and corrected potential problems? N/A -- can't even get to the point of having a site to check

  • included a minimal, self-contained, and reproducible example? N/A -- I am stuck before the process begins

  • [ x] pasted the output from xfun::session_info('blogdown') in your issue?

  • [x ] upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?

  • installed and tested your bug with the development version of the blogdown package using remotes::install_github('rstudio/blogdown') ? this is the version I had just installed at the time I encountered the error

-->

@sammo3182
Copy link

Same problem from a Windows system with the dev version of Rstudio. The problem looks common among users. See the discussion starting also by Jen here rbind/apreshill#44 (comment). I used to be a user of the hugo-academic. Now it seems that neither the old version or the wowchemy version can build up the website. Hope a solution soon 🤞

@cderv
Copy link
Collaborator

cderv commented Jul 9, 2021

I can confirm this is an issue currently.

For context, Academic is a theme that requires Go to work because it is using Hugo Modules, so officially the installation step have a prerequisite for Go to be installed when working locally : https://wowchemy.com/docs/getting-started/install-hugo-extended/#prerequisites

In blogdown, we have tried to bypass this so that Go is not needed. It was done in da068a7

It seems that it no more works as expected. The Go module in question is correctly downloaded from Github, but it is not extracted correctly because what we expect is not there anymore.

I believe this has to do with a very recent change in hugo academic starter kit.
HugoBlox/theme-academic-cv@09b4c21#diff-5bed2c958464666aa841aecfa747db471387119abc35bb3fbb729565aaac8818

So I think this is the cause of the issue with bookdown.

We'll look into that

@cderv cderv added bug an unexpected problem or unintended behavior next to consider for next release labels Jul 9, 2021
@cderv
Copy link
Collaborator

cderv commented Jul 9, 2021

After looking into this, I think it got more complicated to get around the Go requirement to make this theme works asis with blogdown.

Here are some notes on my deep dive into Go modules :)

We need to take into account more cases about how Go modules is handled.

By using both files we should be able to download and install the right thing.

Still a workaround though.

Best thing would be to have a try at following the theme installation instruction with the go requirement. However, blogdown may still lack support for config directory #611

Anyway, i'll keep having a look into this.

@jyotishkarc
Copy link

jyotishkarc commented Jul 13, 2021

@cderv So, as of now, there's absolutely no way to create a site by blogdown using the Hugo Academic theme ? :(
If yes, can someone please write the process in brief ?

@cderv
Copy link
Collaborator

cderv commented Jul 13, 2021

The main issue is that the Academic theme requires Go to be installed to create the site. This is because the Hugo theme is a Go module of the starter site (Hugo Modules. blogdown does not handle Go currently and use workaround.
The second issue is that the theme is using a config dir, which is not yet supported (#611)

So it could probably work with Manual step, but I did not tried it (yet):

  1. For the first issue, follow the Getting Started for the theme and install it without blogdown. https://wowchemy.com/docs/getting-started/ However, this will require to have Go installed. After this, the site should work using Hugo.
  2. Make the config dir become a single file configuration so that it is supported by blogdown (if possible)
  3. Create a RStudio project manually.

Maybe after this, it will work with blogdown.

We are sorry for this inconvenience. The Academic theme went a direction with a Go dependency which is not great for our R tooling only. We are working on it to see how we can support again the Academic theme.

In case you don't know, we have been working on a new theme with a lot a feature that could in some case replace the Academic theme: https://hugo-apero-docs.netlify.app/
If you are starting a new site and it fits your need, you may consider it too.

@apreshill do you have more insights on current workaround for this ?

@apreshill
Copy link
Contributor

apreshill commented Jul 13, 2021

If you must use Hugo Wowchemy, for now, you must follow the developer's installation instructions to a "T": https://wowchemy.com/docs/getting-started/install/

Blogdown had previously attempted to help shield users from the new Go module infrastructure that Wowchemy has adopted, which @cderv described above, and which I documented here: https://alison.rbind.io/blog/2020-12-new-year-new-blogdown/. That workflow unfortunately stopped working due to some upstream changes made in the Wowchemy repos.

I was able to get a new site sort of hobbling along by following the Wowchemy install instructions, then manually moving the config/_default/config.yaml file to the project root. I was able to serve site locally with blogdown after upgrading my Hugo version to 0.84.4 (see instructions here: https://blog.rstudio.com/2021/01/18/blogdown-v1.0/#hugo-versioning-system).

But I cannot work with the theme packaged as Go modules easily locally, so I did develop a Hugo theme that has very similar features: https://hugo-apero-docs.netlify.app/

There is a "get started" section here that attempts to be very thorough (feedback welcome): https://hugo-apero-docs.netlify.app/start/

Some example websites: https://hugo-apero-docs.netlify.app/project/

I also recently did a two-hour workshop for R-Ladies Tunis on how to use the theme- the workshop is freely available on YouTube: https://alison.rbind.io/talk/2021-iyo-tunis/

I know though that it feels not great to be told that you need to consider switching themes after investing lots of time, energy, and material development into the Hugo Academic theme. But this is where we sit now. We'll work to see if we can make it user-friendly again, but at the end of the day, these are ultimately decisions made by individual Hugo theme authors.

@yihui
Copy link
Member

yihui commented Jul 15, 2021

After spending a couple of hours on investigating this issue, personally I'd strongly recommend that future users consider the Apero theme mentioned above instead of Wowchemy. However, the bad news is that I can probably save you one more time if you want to stick with the Wowchemy theme. This issue seems to be fixable to me, but I can't guarantee that it won't happen again in the future. At some point, I might have to just give up and let users follow the official instructions to install extra system dependencies like Go and GIT...

@yihui yihui closed this as completed in 16f85a5 Jul 16, 2021
@yihui
Copy link
Member

yihui commented Jul 16, 2021

Should be fixed now. Please try the development version of blogdown:

remotes::install_github('rstudio/blogdown')

Thanks!

@jyotishkarc
Copy link

jyotishkarc commented Jul 16, 2021

@yihui I used the development version (i.e. I used remotes::install_github('rstudio/blogdown') to install blogdown). But still it didn't work.

Just asking, if I install blogdown by the above way, do I need to load the package by some special command ? I mean, after installing, I simply used library(blogdown) to load the package. Is this the correct way to load the development version of the package ?

@cderv
Copy link
Collaborator

cderv commented Jul 16, 2021

@jyotishkarc do you still have the same error ?

I just bump the dev version number following the above fix. Please try reinstall using

remotes::install_github('rstudio/blogdown')

then Restart R and check the package version. It should be like this:

> packageVersion("blogdown")
[1] ‘1.3.4

When I install the dev version, it is working as expected. If it still don't, please share some details. Thanks!

do I need to load the package by some special command ? I mean, after installing, I simply used library(blogdown) to load the package. Is this the correct way to load the development version of the package ?

No after installation using remotes::install_github(), a usual library(blogdown) will work. But restart your R session first maybe after installation

@jyotishkarc
Copy link

It works !!!! Thank you so much @yihui and @cderv . I guess there were some problems while I installed blogdown previously, in spite of the fact that I did that just like @yihui said. Probably I didn't restart the session, and I guess it is compulsory to restart the R session after installing.

Anyway, it is working now. Many thanks.

Regards,
Jyotishka

@jyotishkarc
Copy link

jyotishkarc commented Jul 18, 2021

I'm sorry to ask this here, but I'm having problems while trying to deploy my newly created site using GitHub pages (I don't want to use Netlify). Can someone help me regarding this, or maybe tell me about some appropriate place where I may get some help ?

Also, is there a place where I can ask questions about this ? I was having some problems while customizing the site too.

@izhenyang
Copy link

@juniperover here is a tutorial I found:
https://matteocourthoud.github.io/post/website/

@cderv
Copy link
Collaborator

cderv commented Jul 19, 2021

@jyotishkarc you can ask question in https://community.rstudio.com for example.
You have a chapter in the book about this too: https://bookdown.org/yihui/blogdown/github-pages.html

One difference with Netlify is that you would need to build the blog locally to generate the generated website folder and commit it (in gh-pages or a hosted folder), where Netlify can build the website itself with Hugo and so only need your source files to be commited.

Also as @izhenyang mentioned, there should be some tutorial on the web to help you. If they have a comment feature, you can also try to ask for advice there if you have questions about the post.

GH issues is unfortunately not the best place to ask for help by the community. Prefer Q&A website. Twitter is also a place you can easily find help as the #rstat community is very active and welcoming.

Hope it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior next to consider for next release
Projects
None yet
Development

No branches or pull requests

7 participants