This is a template (and tutorial) for creating your blog with R Markdown in minutes.
This template is mostly based on Jekyll Now. It adds some adjustments to properly render your posts based on R Markdown files. I'm no expert in HTML so some lines of code may be useless.
- Make sure that you have the latest versions of R and RStudio.
- Install package prettyjekyll with
devtools::install_github("privefl/prettyjekyll")
. - Make sure that you have enabled Git in RStudio. More information can be found there.
- You need a GitHub account.
- You need your own GitHub page. You can find a template (and tutorial) for creating it in minutes there.
- Fork this repo and rename it to be 'blog' (in Settings of your brand new repo).
- Get the link from cloning the repo. Then, go to RStudio, create a New Project > Version Control > Git and copy this link. You have cloned your new repo as an R project.
- Modify
_config.yml
. - Go knit the R Markdown file in directory
_knitr
if you want to see its HTML preview in RStudio. Then useprettyjekyll::FormatPost("_knitr/knitr-minimal.Rmd")
in the console. - Commit and push everything from RStudio.
- Go see this post at https://YOURGITHUB.github.io/blog.
- Create an Rmd document with the template from package prettyjekyll.
- Fill it, previewing the result with the Knit button. The main content should be the same in your future post.
- When you have finished, use
prettyjekyll::FormatPost
on your R Markdown file and commit/push the changes from RStudio. - Go verify that it renders well on your blog.
More information can be found there.
You can see for example the blog part of my own website.
For example,
- see this post and what was its html preview in RStudio. Pretty close, no?
I wanted something for creating my website, blogging and posting on it, that
- was very simple to use,
- didn't need any further installation (no Jekyll, Ruby or whatever),
- could be previewed directly from RStudio at any moment.
As a reminder, most credit goes to the contributors of Jekyll Now and its author Barry Clark. I also used parts of the css files and templates in package prettydoc.
If anything is false or not clear enough, feel free to contact me or open an issue.