登录
首页 >  Golang >  Go问答

必须安装Go以使用Academic Hugo主题的blogdown

来源:stackoverflow

时间:2024-02-18 21:21:26 363浏览 收藏

你在学习Golang相关的知识吗?本文《必须安装Go以使用Academic Hugo主题的blogdown》,主要介绍的内容就涉及到,如果你想提升自己的开发能力,就不要错过这篇文章,大家要知道编程理论基础和实战操作都是不可或缺的哦!

问题内容

描述

我想用 blogdown 建立一个个人网站,使用学术雨果主题。我几乎阅读了 blogdown 的整本书:使用 r markdown 创建网站以及一些教程,例如 allison hill 或 annie lyu 的教程。

我选择 blogdown 是因为我熟悉 rstudio 和 r 以及学术,因为参考文献中有建议选择一个维护的主题,例如学术。我按照书中的建议安装了blogdown和hugo,并尝试通过rstudio方式安装主题:单击文件->新项目->新目录->使用blogdown的网站。如果我尝试了hugo-lithium主题,一切都进展顺利。如果我尝试学术,则会出现以下消息和错误(某些已安装的文件位于指定目录中):

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 " command.
2. perhaps you want to add some content. you can add single files
   with "hugo new \.".
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

问题

我需要安装go才能使用这个主题吗? 1.1 安装没有提及任何关于 go 的内容(在2.1 静态站点和 hugo 部分下面,由我突出显示),也没有提及教程。这与主题的发布有关吗?这本书已经过时了吗?

我们喜爱雨果的原因有很多,但有几个原因最为突出。与其他静态站点生成器不同,hugo 的安装非常简单,因为它为大多数操作系统提供了一个不依赖的可执行文件。

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

解决方案


按照学术主题网页上的 Edit your site on your PC 文档进行操作:

在下载您的网站之前,我们首先安装 Hugo Extended 及其先决条件。

在 Windows 上:Git、OpenSSH 和 Go 必须与 Hugo Extended 一起安装。因为我已经有了Git,所以没有安装它,只有OpenSSH和Hugo Extended via Scope(以及之前的Powershell 5来安装Scope)。 Go 是通过 the Go documentaion site 中的可执行文件安装的。

此后,可以使用问题中指定的 RStudio 方法来部署学术主题。也许 blogdown 书需要更新。

注意:另外,在引用的文档中:

转换旧的学术 Kickstarter 网站 如果您有一个基于 2020 年 9 月 3 日之前创建的学术 Kickstarter 模板的现有网站,则可能需要转换为使用 Hugo 的新模块化系统。

文中关于的知识介绍,希望对你的学习有所帮助!若是受益匪浅,那就动动鼠标收藏这篇《必须安装Go以使用Academic Hugo主题的blogdown》文章吧,也可关注golang学习网公众号了解相关技术文章。

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>