Need to install Go to use blogdown with Academic Hugo theme

半城伤御伤魂 提交于 2021-01-28 07:01:55

问题


Description

I wanted to set up a personal website with blogdown, using the Academic Hugo theme. I almost read the entire book of blogdown: Creating Websites with R Markdown and several tutorials, like Allison Hill's or Annie Lyu's.

I have chosen blogdown because I am familiar with RStudio and R and Academic because there are suggestions in the references to pick a maintained theme, like Academic. I installed blogdown and Hugo as the book suggests and tried to install the theme by the RStudio way: click File -> New project -> New Directory -> Website using blogdown. If I tried the hugo-lithium theme, everything flows great. If I tried Academic, then the following message and error appeared (with some already installed files in the specified directory):

Congratulations! Your new Hugo site is created in C:\Users\HP\Documents\R\website.

Just a few more steps and you're ready to go:

1. Download a theme into the same-named folder.
   Choose a theme from https://themes.gohugo.io/ or
   create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".

Visit https://gohugo.io/ for quickstart guide and full documentation.
trying URL 'https://github.com/wowchemy/starter-academic/archive/master.tar.gz'
Content length 133 bytes
downloaded 4.8 MB

Error: we found a go.mod file in your project, but you need to install Go to use it. See https://golang.org/dl/.: module "github.com/wowchemy/wowchemy-hugo-modules/wowchemy" not found; either add it as a Hugo Module or store it in "C:\\Users\\HP\\Documents\\R\\website\\themes".: module does not exist
Error: we found a go.mod file in your project, but you need to install Go to use it. See https://golang.org/dl/.: module "github.com/wowchemy/wowchemy-hugo-modules/wowchemy" not found; either add it as a Hugo Module or store it in "C:\\Users\\HP\\Documents\\R\\website\\themes".: module does not exist
Error: we found a go.mod file in your project, but you need to install Go to use it. See https://golang.org/dl/.: module "github.com/wowchemy/wowchemy-hugo-modules/wowchemy" not found; either add it as a Hugo Module or store it in "C:\\Users\\HP\\Documents\\R\\website\\themes".: module does not exist
Error in shell(cmd, mustWork = TRUE, intern = intern) : 
  '"hugo" convert toYAML --unsafe' execution failed with error code 65535
In addition: Warning message:
In untar2(tarfile, files, list, exdir) :
  skipping pax global extended headers

Question

Do I need to install Go to use this theme? The 1.1 Installation does not mention anything about Go (below section 2.1 Static sites and Hugo, highlight by me), nor the tutorials. Is this connected with a release of the theme? Is the book outdated?

We love Hugo for many reasons, but there are a few that stand out. Unlike other static site generators, the installation of Hugo is very simple because it provides a single executable without dependencies for most operating systems.

The sessionInfo:

> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Hungarian_Hungary.1250  LC_CTYPE=Hungarian_Hungary.1250   
[3] LC_MONETARY=Hungarian_Hungary.1250 LC_NUMERIC=C                      
[5] LC_TIME=Hungarian_Hungary.1250    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.0 bookdown_0.18  tools_4.0.0    blogdown_0.20  knitr_1.28    
[6] xfun_0.13

回答1:


Following the Edit your site on your PC docs on the Academic theme's webpage:

Before downloading your site, lets first install Hugo Extended and its prerequisites.

On Windows: Git, OpenSSH and Go have to be installed beside Hugo Extended. Because I already have Git, I did not install it, only OpenSSH and Hugo Extended via Scope (and beforehand Powershell 5 to install Scope). Go was installed via the executable from the Go documentaion site.

After this, Academic theme can be deployed with the RStudio method specified in the question. Maybe the blogdown book need to be updated.

Note: also, in the referenced document:

Convert an old Academic Kickstarter site If you have an existing site based on the Academic Kickstarter Template that was created before 3rd September 2020, it may need converting to use Hugo’s new modular system.



来源:https://stackoverflow.com/questions/63898557/need-to-install-go-to-use-blogdown-with-academic-hugo-theme

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!