rstudio / blogdown

Create Blogs and Websites with R Markdown
https://pkgs.rstudio.com/blogdown/
1.73k stars 334 forks source link

ERROR ... Failed to execute template / Error while rendering page #229

Closed Tazinho closed 6 years ago

Tazinho commented 6 years ago

This is somehow similar to #177 and #121. I also tried to resolve the issue via recommended instructions described in https://bookdown.org/yihui/blogdown/other-themes.html

I am trying to set up the startbootstrap-clean-blog theme and always run into the same error. The following workflow does work in case of other Hugo themes like crakjie/landing-page-hugo.

My system is:

> setwd("../AlmostRandomTest/")
> library("blogdown")
> new_site(theme = "humboldtux/startbootstrap-clean-blog")
Congratulations! Your new Hugo site is created in D:\R\Projects\AlmostRandomTest.

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 <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
   with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>".
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/humboldtux/startbootstrap-clean-blog/archive/master.zip'
Content type 'application/zip' length unknown
downloaded 2.0 MB

Warning: You are recommended to ignore certain files in config.toml: set the option ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"]
Rendering content/post/2015-07-23-r-rmarkdown.Rmd
Started building sites ...
ERROR 2017/11/10 14:28:55 in .Render: Failed to execute template "theme/post/archive.html" for page "post\\2015-07-23-r-rmarkdown.html"
ERROR 2017/11/10 14:28:55 Error while rendering "page": template: theme/post/single.html:15:20: executing "theme/post/single.html" at <partial "meta.html" ...>: error calling partial: template: theme/partials/meta.html:4:74: executing "theme/partials/meta.html" at <.Site.Params.datefor...>: invalid value; expected string
Started building sites ...
ERROR 2017/11/10 14:28:55 Error while rendering "page": template: theme/post/single.html:15:20: executing "theme/post/single.html" at <partial "meta.html" ...>: error calling partial: template: theme/partials/meta.html:4:74: executing "theme/partials/meta.html" at <.Site.Params.datefor...>: invalid value; expected string
The system cannot find the path specified.
Error in shell(cmd, mustWork = TRUE, intern = intern) : 
  '"C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' execution failed with error code 1
In addition: Warning messages:
1: running command '"C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' had status 65535 
2: running command '"C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' had status 65535 
3: running command 'C:\Windows\system32\cmd.exe /c "C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' had status 1 

> setwd("../AlmostRandomTest/") > library("blogdown") > new_site(theme = "humboldtux/startbootstrap-clean-blog") Congratulations! Your new Hugo site is created in D:\R\Projects\AlmostRandomTest.  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 <THEMENAME>" command. 2. Perhaps you want to add some content. You can add single files    with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>". 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/humboldtux/startbootstrap-clean-blog/archive/master.zip' Content type 'application/zip' length 2074569 bytes (2.0 MB) downloaded 2.0 MB  Warning: You are recommended to ignore certain files in config.toml: set the option ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"] Rendering content/post/2015-07-23-r-rmarkdown.Rmd Started building sites ... ERROR 2017/11/10 14:40:01 Error while rendering "page": template: theme/post/single.html:15:20: executing "theme/post/single.html" at <partial "meta.html" ...>: error calling partial: template: theme/partials/meta.html:4:74: executing "theme/partials/meta.html" at <.Site.Params.datefor...>: invalid value; expected string Started building sites ... ERROR 2017/11/10 14:40:01 in .Render: Failed to execute template "theme/post/archive.html" for page "post\\2015-07-23-r-rmarkdown.html" ERROR 2017/11/10 14:40:01 Error while rendering "page": template: theme/post/single.html:15:20: executing "theme/post/single.html" at <partial "meta.html" ...>: error calling partial: template: theme/partials/meta.html:4:74: executing "theme/partials/meta.html" at <.Site.Params.datefor...>: invalid value; expected string The system cannot find the path specified. Error in shell(cmd, mustWork = TRUE, intern = intern) :    '"C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' execution failed with error code 1 In addition: Warning messages: 1: running command '"C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' had status 65535  2: running command '"C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' had status 65535  3: running command 'C:\Windows\system32\cmd.exe /c "C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' had status 1

Next I added the line ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"] to config.toml

and then tried to use serve_site()

> blogdown::serve_site()
Started building sites ...
ERROR 2017/11/10 17:23:15 Error while rendering "page": template: theme/post/single.html:15:20: executing "theme/post/single.html" at <partial "meta.html" ...>: error calling partial: template: theme/partials/meta.html:4:74: executing "theme/partials/meta.html" at <.Site.Params.datefor...>: invalid value; expected string
Started building sites ...
ERROR 2017/11/10 17:23:15 Error while rendering "page": template: theme/post/single.html:15:20: executing "theme/post/single.html" at <partial "meta.html" ...>: error calling partial: template: theme/partials/meta.html:4:74: executing "theme/partials/meta.html" at <.Site.Params.datefor...>: invalid value; expected string
The system cannot find the path specified.
Error in shell(cmd, mustWork = TRUE, intern = intern) : 
  '"C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' execution failed with error code 1
In addition: Warning messages:
1: running command '"C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' had status 65535 
2: running command '"C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' had status 65535 
3: running command 'C:\Windows\system32\cmd.exe /c "C:\Users\MGO\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t startbootstrap-clean-blog' had status 1 

I'd be happy about any instructions to handle this. Best, Malte

henningsway commented 6 years ago

to add on this: the replacement of config.toml with the contents of theme/theme.toml as described in https://bookdown.org/yihui/blogdown/other-themes.html#fn18 did also not resolve the issue.

yihui commented 6 years ago

@Tazinho Please read the documentation of the theme: https://github.com/humboldtux/startbootstrap-clean-blog and add the DateForm parameter to config.toml.

Next time please consider asking questions on StackOverflow. Thanks!

@henningsway As a user, you never need to look at theme.toml. I don't think I have mentioned anything about theme.toml in the blogdown book. This file is primarily for the theme author.

Tazinho commented 6 years ago

Thank you! Also for the issue regarding the theme. And sure, next time I'll start at SO.