Add a blog to your website in minutes
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
- 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.
Get a first post on your blog
- 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.
- Go knit the R Markdown file in directory
_knitrif you want to see its HTML preview in RStudio. Then use
prettyjekyll::FormatPost("_knitr/knitr-minimal.Rmd")in the console.
- Commit and push everything from RStudio.
- Go see this post at https://YOURGITHUB.github.io/blog.
Get your own post on your 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::FormatPoston your R Markdown file and commit/push the changes from RStudio.
- Go verify that it renders well on your blog.
Requirements and features of FormatPost
More information can be found there.
You can see for example the blog part of my own website.
Why should you care?
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.
If anything is false or not clear enough, feel free to contact me or open an issue.