Recipe for the summer 2018 edition of Machine Learning chalet
- your favorite R distribution
- your favorite IDE
- 1 pinch of an internet connection
- Install the required packages at the R command line
install.packages("blogdown")
install.packages("rmarkdown")
- Try this markdown demo to familiarize yourself with markdown
- Save this file as "file/path/test.Rmd"
- Render that file as an html document with the following R command
rmarkdown::render(input = "file/path/test.Rmd", output_format = "html_document")
- Open the newly created "file/path/test.html" HTML file with your browser, and compare it to the corresponding test.Rmd source code
- At the R command line, run the following chunk to install the most up-to-date Hugo library
blogdown::install_hugo()
- Create a new local repository where you want your website to be contained (for example, under path "your/repo/path")
- In your R session, set your working directory to your new repo, either explicitly (
setwd("your/repo/path")
at the R command line) or by creating a RStudio project in the folder - At the R command line, run the following chunk to create your website from this template
blogdown::new_site(dir = ".", theme = "yihui/hugo-lithium")
- At the R command line, run the following chunk to visualize your website from your local browser
blogdown::serve_site()
- Save the following file as static/images/dastat-logo.JPG
- Save the following file as config.toml
- Preview your website again and notice the logo and header changes
blogdown::serve_site()
- At the R command line, run the following chunk to create your first article
blogdown::new_post(title = "My first post")
- Go check the new post in content/post. Notice the post is a .md file
- At the R command line, run the following chunk to create your second article. This time, it will be a rmarkdown article
blogdown::new_post(title = "My second post", ext = ".Rmd")
- Now save this file as "content/post/2018-08-25-my-third-post.Rmd"
- Save this other file as "content/post/2018-08-25-my-fourth-post.Rmd"
- In "content/post/2018-08-25-my-fourth-post.Rmd", replace the yaml header by this header
---
title: My fourth post
author: My Name
date: "`r format(Sys.time(), '%Y-%m-%d')`"
slug: my-fourth-post
categories: ["AI", "Machine Learning"]
tags: ["hype", "buzzword", "witchcraft", "black magic"]
---
- Look at these websites that were made with blogdown :