Florian Privé

R(cpp) enthusiast

A website and blog for R users

Written on August 19, 2016

In this post, I will show you how to quickly create your website, blog and first posts. This is designed for R users only.

Philosophy

  • This had to be free.
  • This had to be easy.
  • This had to only need RStudio and GitHub.
  • Every content had to be previewable from RStudio.

The website

Follow this tutorial to create your own website in minutes.

I chose not to use a Jekyll-based template for the website because

  • you would need to configure a local install of Jekyll to preview your website,
  • using R Markdown to create your website is only natural for an R user.

Thanks RStudio and GitHub pages!

The blog and first posts

Follow this tutorial to create your own blog and get your first posts in minutes.

I chose to use the Jekyll Now template. I extended it so that posts have a similar rendering as an HTML Pretty Document with theme “cayman” and highlight “github”. I also created a function called FormatPost to convert your R Markdown documents in your future posts.

Essentially,

  • you create an R Markdown document from the template of package prettyjekyll,
  • you preview it as an HTML Pretty Document with RStudio’s knit button,
  • when you are happy with the result, you use FormatPost on the Rmd file,
  • you commit and push the changes from RStudio,
  • you go see your post on your blog.

Explanation

The FormatPost function takes the main content of the HTML pretty document, puts it in some Markdown file with some YAML header. It also takes care of images’ and figures’ paths (note that caching is not supported).

Examples

You can see for example my own website.

For example of posts,

Pretty close, no?