0

I am trying to install hugo-academic theme in blogdown. Within my site directory I ran R and installed with

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

After installing I edited the config.toml file as shown below:

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

After that when I try to serve site with blogdown::serve_site(), I get the following error:

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

Any help to solve this?

Note: I am on Windows 10 64 bit OS.

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
Suman Khanal
  • 3,079
  • 1
  • 17
  • 29

1 Answers1

2

Judging from the error message, you need to add a date_format parameter to your config.toml file. Try adding this at the end:

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

Take a look at the example config file for more settings that you can change.

Jack Taylor
  • 5,588
  • 19
  • 35
  • 1
    Yep, I also think that is the problem. @Suman you need to read https://bookdown.org/yihui/blogdown/other-themes.html and I recommended `new_site()` instead of `install_theme()` exactly because of this problem. – Yihui Xie Jun 03 '17 at 21:18
  • After adding `[params] date_format = "Mon, Jan 2, 2006"`, yeah its working. Thanks @Jack Taylor and @Yihui. blogdown/bookdown/pkgdown are awesome!! – Suman Khanal Jun 04 '17 at 05:20