Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change blog theme (blogdown+netlify)

I have followed tutorial by Yihui and created a website using blowdown, github and netlify. Now, I want to change theme of my website. The issue is that I have several posts that produces many plots. As a result when I create a new website locally and add my posts, git push fails. I suspect it is because I have too many files.

I tried adding posts piece by piece as if I am writing a new post, which worked. But it will take too much time. I suspect others have the same problem. Is there a way to change theme of my website easier?

like image 653
Masood Sadat Avatar asked Jul 04 '18 14:07

Masood Sadat


1 Answers

Two ways of changing themes in blogdown, which are documented here:

install the theme via blogdown::install_theme(), or just create a new site under another new directory and pass the GitHub repository name to the theme argument of new_site(). We recommend that you use the second approach, because Hugo themes could be very complicated and the usage of each theme can be very different and highly dependent on config.toml

In your use case, you can
1. blogdown::new_site(theme = "gcushen/hugo-academic") to build a new site
2. Copy your *.Rmd|*.md|*.Rmarkdown files into content/post
3. blogdown::serve_site(), if local preview is ok
4. setup github repo, push your new site to it ,and connects to netlify

It's strange that git push failed, it would be of great help to share the error message.

like image 133
TC Zhang Avatar answered Nov 13 '22 11:11

TC Zhang