我正在尝试通过RStudio使用blogdown
创建一个网站。我创建一个新项目,创建一个新目录并输入matcornic/hugo-theme-learn
作为主题值。学习主题可以在https://github.com/matcornic/hugo-theme-learn找到。我遵循博客书中概述的基本步骤。我的新目录是我桌面上的一个子目录。
当我尝试使用RStudio通过 Addins - Serve Site 构建网站时,我收到一条错误消息,指出无法找到hugo-theme-learn
文件夹,因为它正在尝试找到{{1我的桌面上的文件夹,而不是我的项目目录中。如果我将hugo-theme-learn
文件夹复制并粘贴到我的桌面,它似乎运行正常。我尝试更改hugo-theme-learn
值,但仍在我的桌面上搜索themesdir
文件夹。非常感谢任何想法!
我的hugo-theme-learn
R
如下:
sessionInfo()
和我的R version 3.4.2 (2017-09-28)
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=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] blogdown_0.1 RevoUtils_10.0.6 RevoUtilsMath_10.0.1
loaded via a namespace (and not attached):
[1] compiler_3.4.2 tools_3.4.2 yaml_2.1.14
verision:
hugo
作为参考,我收到的错误信息是:
Hugo Static Site Generator v0.41 windows/amd64 BuildDate: 2018-05-25T16:57:53Z
,默认的Error: Unable to find theme Directory: C:\Users\scott.prevost\hugo-theme-learn
The system cannot find the path specified.
Error in shell(cmd, mustWork = TRUE, intern = intern) :
'"C:\Users\scott.prevost\AppData\Roaming\Hugo\hugo.exe" -b /localhost:1313/test -D -F -d "public" -t hugo-theme-learn' execution failed with error code 1
In addition: Warning messages:
1: running command '"C:\Users\scott.prevost\AppData\Roaming\Hugo\hugo.exe" -b /localhost:1313/test -D -F -d "public" -t hugo-theme-learn' had status 65535
2: running command '"C:\Users\scott.prevost\AppData\Roaming\Hugo\hugo.exe" -b /localhost:1313/test -D -F -d "public" -t hugo-theme-learn' had status 65535
3: running command 'C:\WINDOWS\system32\cmd.exe /c "C:\Users\scott.prevost\AppData\Roaming\Hugo\hugo.exe" -b /localhost:1313/test -D -F -d "public" -t hugo-theme-learn' had status 1
文件为:
config.toml
答案 0 :(得分:2)
您可以将themesdir
行全部注释掉以避开问题。
请注意,其他主题(例如hugo-icarus-theme)在主题config.toml to mention this as a possibility中包含注释。如果您在制作中使用此主题,该主题将评论themesDir选项。