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.42k stars 2.91k forks source link

Problem with: blogdown::new_site(theme = "gcushen/hugo-academic") #1845

Closed TimDominikMaurer closed 4 years ago

TimDominikMaurer commented 4 years ago

Whenever I am trying to run blogdown::new_site(theme = "gcushen/hugo-academic") in RStudio I get the following Error:

Error: "C:\Users\tima.eco\OneDrive - Copenhagen Business School\Studium\PhD\Personal-Website\content\home\demo.md:39:1": failed to extract shortcode: template for shortcode "alert" not found
Error: "C:\Users\tima.eco\OneDrive - Copenhagen Business School\Studium\PhD\Personal-Website\content\home\demo.md:39:1": failed to extract shortcode: template for shortcode "alert" not found
Error: "C:\Users\tima.eco\OneDrive - Copenhagen Business School\Studium\PhD\Personal-Website\content\home\demo.md:39:1": failed to extract shortcode: template for shortcode "alert" not found
Error in shell(cmd, mustWork = TRUE, intern = intern) : 
  '"C:\Users\tima.eco\AppData\Roaming\Hugo\hugo.exe" convert toYAML --unsafe' execution failed with error code 65535
In addition: There were 27 warnings (use warnings() to see them)

Do you have an idea how I can solve this problem? Thanks in advance

erikriverson commented 4 years ago

@TimDominikMaurer try this now:

blogdown::new_site(theme = "wowchemy/starter-academic")

LunaSare commented 4 years ago

@erikriverson thanks for the post! Maybe @yihui also have some suggestions?

I am having trouble with generating a new site with blogdown, and also with rendering old sites I have generated using the hugo-academic theme. I posted my issue on stackoverflow 2 days ago: https://stackoverflow.com/questions/63931103/hugo-academic-website-rendered-unformatted-using-blogdownserve-site

I successfully used blogdown::new_site(theme = "wowchemy/starter-academic", dir = "/Users/luna/my_site") to generate a new site, as you suggested. However, doing blogdown::serve_site() is giving me:

Error: Error building site: "/Users/luna/my_site/content/home/demo.md:39:1": failed to extract shortcode: template for shortcode "alert" not found

I also tried reinstalling the theme with blogdown::install_theme(theme = "wowchemy/wowchemy-hugo-modules", force = TRUE) but the same error appears.

I sense that my hugo academic theme installation is failing but I don't know what to do next. Would you have any suggestions? I know you are busy people, I really appreciate any thought you could have on this. Thanks in advance!

erikriverson commented 4 years ago

@LunaSare From your site's directory, try

hugo mod get github.com/wowchemy/wowchemy-hugo-modules/wowchemy

You will need the Go binary installed for your operating system for this to work.

gcushen commented 4 years ago

Please try the official installation guide.

The official installation instructions are here: https://wowchemy.com/docs/install/ To edit on PC see the official guide at https://wowchemy.com/docs/install-locally/

Note there are reports from other Blogdown users with the alternative blogdown::new_site approach you are using that Blogdown might be buggy and not fully support recent versions of Hugo, specifically Hugo Modules and monorepo module functionality. If you were to try installing via Blogdown rather than the official approach, the command would be something like blogdown::new_site(dir = "website",theme="wowchemy/wowchemy-hugo-modules/wowchemy") - consider reporting any Blogdown bugs in the Blogdown Github repo.

yihui commented 4 years ago

@TimDominikMaurer @LunaSare @erikriverson I'll appreciate it if you could try the development version of blogdown, in which I have tried to provide a fix:

remotes::install_github('rstudio/blogdown')

The original command blogdown::new_site(theme = "gcushen/hugo-academic") should work now.

If you were to try installing via Blogdown rather than the official approach, the command would be something like blogdown::new_site(dir = "website",theme="wowchemy/wowchemy-hugo-modules/wowchemy") - consider reporting any Blogdown bugs in the Blogdown Github repo.

@gcushen That won't work. new_site() doesn't support theme = "user/repo/subfolder".

I still need to learn more about this new "Hugo modules". It might be great for theme or Go developers, but from the perspective of an average user, I feel it's a rather unfortunate decision to move to Hugo modules, because it requires Go and GIT if we want to preview or edit the site locally. One of the greatest advantage of Hugo used to be that it is a single binary without dependencies. Now with Hugo modules, this is no longer true.

Anyway, that's just my 2 cents. I'll just follow your steps (and Hugo's) and try to accommodate these changes on my side as quickly as possible. Thanks!

LunaSare commented 4 years ago

Thanks @yihui, installing the development version of blogdown fixed it!

Fyi, the site was rendering correctly once published, it just wasn't rendering locally with serve_site(). Thought I'd mention it in case it is useful information for anyone.

yihui commented 4 years ago

@LunaSare Great! Please feel free to file an issue to the blogdown repo to describe the problem with serve_site() in more detail. Thank you!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any recent activity. The resources of the Academic team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically close soon if no further activity occurs. Thank you for your contributions.