【问题标题】:About theme (hugo-academic) in blogdown关于 blogdown 中的主题(hugo-academic)
【发布时间】:2017-06-01 14:48:57
【问题描述】:

我正在尝试在 blogdown 中安装 hugo-academic 主题。在我的站点目录中,我运行 R 并安装了

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 位操作系统。

【问题讨论】:

  • 只是一个猜测,但我认为你的 baseurl 应该是“。”这里有关于这个主题的更多信息:gohugo.io/extras/urls
  • @sinQueso 这应该不是问题。

标签: r hugo blogdown


【解决方案1】:

从错误信息来看,你需要在你的config.toml文件中添加一个date_format参数。尝试在最后添加:

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

查看example config file 了解更多可以更改的设置。

【讨论】:

  • 是的,我也认为这是问题所在。 @Suman 你需要阅读bookdown.org/yihui/blogdown/other-themes.html,我推荐new_site() 而不是install_theme() 正是因为这个问题。
  • 添加[params] date_format = "Mon, Jan 2, 2006" 后,是的。感谢@Jack Taylor 和@Yihui。 blogdown/bookdown/pkgdown 太棒了!!
猜你喜欢
  • 2018-12-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-11-05
  • 2019-05-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多