更改博客主题(blogdown+netlify) [英] Change blog theme (blogdown+netlify)

查看:66
本文介绍了更改博客主题(blogdown+netlify)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了 Yihui 的教程,并使用 blowdowngithubnetlify 创建了一个网站.现在,我想更改我网站的主题.问题是我有几个帖子产生了很多情节.结果,当我在本地创建一个新网站并添加我的帖子时,git push 失败.我怀疑是因为我的文件太多了.

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?

推荐答案

blogdown 中改变主题的两种方式,分别是 此处记录:

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

通过 blogdown::install_theme() 安装主题,或者只是在另一个新目录下创建一个新站点并将 GitHub 存储库名称传递给 new_site() 的主题参数.我们建议您使用第二种方法,因为 Hugo 主题可能非常复杂,并且每个主题的用法可能非常不同并且高度依赖于 config.toml

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

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

奇怪的是 git push 失败了,如果能把错误信息分享一下会很有帮助的.

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

这篇关于更改博客主题(blogdown+netlify)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆