用RStudio、R、RMarkdown和Jekyll搭建Github博客

1. 在Github建立Jekyll博客

我刚开始尝试根据AndySouth的文章Blog with RStudio, R, RMarkdown, Jekyll and Github,按文中的步骤来搭建博客,但都有问题。html

最后直接用了他搭建的博客,而后修改博客信息和删除他的文章。git

须要修改的信息以下github

  • _config.yml修改博客的我的信息markdown

  • about.md修改关于博客信息svg

  • links.md修改连接信息函数

  • 删除_rmd和_rm文件中的文章spa

  • svg-icons中的disqus.html修改disqus信息
    注册disqus账号后,选择代码,代替disqus.html中的代码便可。code

2. 在Rstudio管理博客

使用RStudio克隆下载博客项目,这个比较简单,彻底按照下列操做就能够完成。htm

修改成本身信息之后,上传到Github有问题,解决方案详见rstudio: error when pushing to github

写第二个博客上传失败,懒的再查了,最后先用Github客户端上传解决了这个问题。

3. 用Rmarkdown写文章

  • _Rmd RMarkdown files that I edit

  • _md md files created by RMarkdown

  • figures plots created by any chunks of R code

首先在_rmd中写Rmarkdown文档,而后在Rstudio运行rmd2md(),而后上传Github便可。

## 查看是否在Github博客项目中,jeevanyue.github.io
getwd()
## 运行rmd2md.R中的rmd2md函数
source("rmd2md.R")
rmd2md()

运行完rmd2md()即将rmd文件转换为md文件,这时需将rmd文件的状态由status: process改成status: done_process,表示已经转换完成,之后不用再转换。

rmd2md

参考资料:

相关文章
相关标签/搜索