2017-06-01 68 views
0

我想在blogdown中安裝hugo-academic主題。在我的網站目錄我跑R和與關於博客中的主題(hugo-academic)

blogdown::install_theme("gcushen/hugo-academic") 

安裝安裝我編輯了config.toml文件後如下圖所示:

baseurl = "/" 
relativeurls = true 
languageCode = "en-us" 
title = "A Hugo website" 
theme = "hugo-academic" 
googleAnalytics = "" 
disqusShortname = "" 
ignoreFiles = ["\\.Rmd$", "_files$", "_cache$"] 

後,當我嘗試以服務網站與 blogdown::serve_site(), 我收到以下錯誤:

Started building sites ... 
ERROR 2017/06/01 20:02:50 Error while rendering "page": template: theme/_default/single.html:10:7: executing "theme/_default/single.html" at <partial "article_met...>: error calling partial: template: theme/partials/article_metadata.html:7:24: executing "theme/partials/article_metadata.html" at <$.Site.Params.date_f...>: invalid value; expected string 
Started building sites ... 
ERROR 2017/06/01 20:02:50 Error while rendering "page": template: theme/_default/single.html:10:7: executing "theme/_default/single.html" at <partial "article_met...>: error calling partial: template: theme/partials/article_metadata.html:7:24: executing "theme/partials/article_metadata.html" at <$.Site.Params.date_f...>: invalid value; expected string 
The system cannot find the path specified. 
Error in shell(cmd, mustWork = TRUE, intern = intern) : 
    '"C:\Users\Suman\AppData\Roaming\Hugo\hugo.exe" -b/-D -F -d "public" -t hugo-academic' execution failed with error code 1 
In addition: Warning messages: 
1: running command '"C:\Users\Suman\AppData\Roaming\Hugo\hugo.exe" -b/-D -F -d "public" -t hugo-academic' had status 65535 
2: running command '"C:\Users\Suman\AppData\Roaming\Hugo\hugo.exe" -b/-D -F -d "public" -t hugo-academic' had status 65535 
3: running command 'C:\WINDOWS\system32\cmd.exe /c "C:\Users\Suman\AppData\Roaming\Hugo\hugo.exe" -b/-D -F -d "public" -t hugo-academic' had status 1 

任何幫助解決此問題?

注意:我在Windows 10 64位操作系統上。

+0

只是一個猜測,但我認爲你的baseurl應該是「。」。這裏有更多關於這個話題的信息:https://gohugo.io/extras/urls/ – sinQueso

+0

@sinQueso這應該不是問題。 –

回答

2

從錯誤消息判斷,您需要將date_format參數添加到您的config.toml文件中。嘗試在結尾處加上這樣的:

[params] 
    date_format = "Mon, Jan 2, 2006" 

看看在example config file進行更多設置,你可以改變。

+0

是的,我也認爲這是問題。 @Suman你需要閱讀https://bookdown.org/yihui/blogdown/other-themes.html,並且我推薦'new_site()'而不是'install_theme()'正是因爲這個問題。 –

+0

加入'[params] date_format =「星期一,2006年1月2日」,是的,它的工作。謝謝@Jack Taylor和@Yihui。 blogdown/bookdown/pkgdown真棒! –