rstudio / blogdown

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

[The theme docDock does not work with blogdown] #340

Closed forvis closed 6 years ago

forvis commented 6 years ago

Hi Yihui and Team

For my use case I'm trying to create a new site with the Docdock theme:

blogdown::new_site(theme = "vjeantet/hugo-theme-docdock")

After this code:

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
Error: Unable to find theme Directory: D:\hugo-theme-docdock

Error: Unable to find theme Directory: D:\hugo-theme-docdock

The system cannot find the path specified.
Error in shell(cmd, mustWork = TRUE, intern = intern) : 
  '"C:\Users\svcuo\AppData\Roaming\Hugo\hugo.exe" -b / -D -F -d "public" -t hugo-theme-docdock' execution failed with error code 1
yihui commented 6 years ago

You need to remove themesDir in config.toml. The theme documentation has told you to do so: https://github.com/vjeantet/hugo-theme-docdock#configure Normally blogdown does this automatically for you, but in this case, the theme author used the lowercase themesdir so blogdown failed to detect it. I have fixed this issue on my side.

But the theme is still not compatible with the latest version of Hugo, which has been reported at https://github.com/vjeantet/hugo-theme-docdock/issues/166. I was able to reproduce the problem:

$ git clone https://github.com/vjeantet/hugo-theme-docdock.git
Cloning into 'hugo-theme-docdock'...

$ cd hugo-theme-docdock/exampleSite/

$ hugo
Building sites … ERROR 2018/10/31 11:02:26 [en] page "/Users/foo/Downloads/hugo-theme-docdock/exampleSite/content/getting-start/_index.md": render of "section" failed: execute of template failed: template: _default/list.html:13:9: executing "_default/list.html" at <partial (printf "%s/...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "S...>: error calling where: Source isn't a field of struct type *hugolib.Page
ERROR 2018/10/31 11:02:26 [en] page "/Users/foo/Downloads/hugo-theme-docdock/exampleSite/content/content-organisation/logo.md": render of "page" failed: execute of template failed: template: _default/single.html:13:9: executing "_default/single.html" at <partial (printf "%s/...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "S...>: error calling where: Source isn't a field of struct type *hugolib.Page
ERROR 2018/10/31 11:02:26 [en] page "/Users/foo/Downloads/hugo-theme-docdock/exampleSite/content/getting-start/installation.md": render of "page" failed: execute of template failed: template: _default/single.html:13:9: executing "_default/single.html" at <partial (printf "%s/...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "S...>: error calling where: Source isn't a field of struct type *hugolib.Page
ERROR 2018/10/31 11:02:26 [en] page "/Users/foo/Downloads/hugo-theme-docdock/exampleSite/content/getting-start/configuration.md": render of "page" failed: execute of template failed: template: _default/single.html:13:9: executing "_default/single.html" at <partial (printf "%s/...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "S...>: error calling where: Source isn't a field of struct type *hugolib.Page
Total in 124 ms
Error: Error building site: failed to render pages: [en] page "/Users/foo/Downloads/hugo-theme-docdock/exampleSite/content/content-organisation/extramenu.md": render of "page" failed: execute of template failed: template: _default/single.html:13:9: executing "_default/single.html" at <partial (printf "%s/...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/flex/body-beforecontent.html:2:10": execute of template failed: template: partials/flex/body-beforecontent.html:3:7: executing "partials/flex/body-beforecontent.html" at <partial "header.html...>: error calling partial: "/Users/foo/Downloads/hugo-theme-docdock/layouts/partials/header.html:2:10": execute of template failed: template: partials/header.html:2:10: executing "partials/header.html" at <where .Site.Pages "S...>: error calling where: Source isn't a field of struct type *hugolib.Page