更改博客主题(blogdown+netlify)

Change blog theme (blogdown+netlify)

我已经按照易辉的教程使用 blowdowngithubnetlify 创建了一个网站。现在,我想更改我网站的主题。问题是我有几个 post 会产生很多图。结果,当我在本地创建一个新网站并添加我的 posts 时,git push 失败了。我怀疑是因为我的文件太多了。

我试过一段一段地添加 posts,就好像我在写一个新的 post,这很有效。但这需要太多时间。我怀疑其他人也有同样的问题。有没有办法更轻松地更改我的网站主题?

在blogdown中改变主题的两种方式,分别是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

在您的用例中,您可以
1.blogdown::new_site(theme = "gcushen/hugo-academic")新建站点
2. 将您的 *.Rmd|*.md|*.Rmarkdown 文件复制到 content/post
3.blogdown::serve_site(),若本地预览正常
4. 设置 github repo,将你的新站点推送到它,并连接到 netlify

很奇怪,git推送失败,如果能把错误信息分享出来,会有很大的帮助。