alex-shpak / hugo-book

Hugo documentation theme as simple as plain book
https://hugo-book-demo.netlify.app
MIT License
3.44k stars 1.18k forks source link

Cannot use the theme in RStudio #148

Closed drfurtado closed 4 years ago

drfurtado commented 4 years ago

I love the theme and would love to use it, but... I follow this workflow to install the theme in a new RStudio project. Then, I got the following error. Now, the site is created, but it has a bad format.

Workflow used: https://bookdown.org/yihui/blogdown/workflow.html Image: https://www.screencast.com/t/9miJvqvFYT

Error

blogdown::new_site(theme = 'alex-shpak/hugo-book') trying URL 'https://github.com/alex-shpak/hugo-book/archive/master.zip' downloaded 933 KB

ERROR 2020/02/19 15:26:45 Failed to read Git log: fatal: not a git repository (or any of the parent directories): .git Error: logged 1 error(s) 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 Building sites … ERROR 2020/02/19 15:26:48 Failed to read Git log: fatal: not a git repository (or any of the parent directories): .git WARN 2020/02/19 15:26:48 found no layout file for "HTML" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. WARN 2020/02/19 15:26:48 found no layout file for "HTML" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination. Total in 259 ms Error: Error building site: logged 1 error(s) To stop the server, run servr::daemon_stop(1) or restart your R session Serving the directory /Users/ovandef/Dropbox/rprojects/personal at http://127.0.0.1:4321/'https://example.com/'

alex-shpak commented 4 years ago

Hi! Such error might happen when hugo tries to read git info. Try setting enableGitInfo: false in your config.toml/.yaml. See: https://gohugo.io/getting-started/configuration/

GitInfo is used to display date of last change for the file.

drfurtado commented 4 years ago

Thanks a lot for the quick response. I followed your instructions and it took care of the error message. However, the site does not render well as you can see by visiting the image below. Do I need to change anything else for it to render? https://www.screencast.com/t/7VcdwYVjy

alex-shpak commented 4 years ago

Seems like CSS and images are not having correct URL. For that you need to check what is actually generated. Maybe open it in browser and see which errors are in console. Or perhaps you need to adjust baseURL values.

Unfortunately I don't have experience with blogdown. This might be related: https://bookdown.org/yihui/blogdown/static-files.html

alex-shpak commented 4 years ago

Also check here: https://bookdown.org/yihui/blogdown/themes.html Params baseurl and relativeurls

alex-shpak commented 4 years ago

Hi! Did you find your way around? Can we close issue?

alex-shpak commented 4 years ago

I will close issue, poke me here if you still need it opened.