Creating a new post (deprecated)


Haky Im


June 16, 2021

Lab notes in Rmarkdown

To publish an analysis note in the notebook, you need to have blogdown and hugo installed on your computer. - install.packages('blogdown') - blogdown::install_hugo() - git clone this repository (for example git clone - Go to the folder where you cloned the repo and open RStudio by double clicking web-lab-notes.Rproj (your Rproj name may be different depending on which repo you cloned) - Start a new analysis by adding a New Post from the addin option at the top of the source panel (this creates a folder in the contents/post/ folder with and and subfolders with figures)

  • Choose the title, author, tags
  • Choose the md format unless you will be be running R commands in the post in which case select R Markdown (.Rmd) format option
  • Save the md or Rmd (for the Rmd this will trigger the rendering of the html). The reason we use *.md format instead of the *.Rmd format is the the md format can be edited directly from github and will be rendered automatically. Rmd needs to be rendered by Rstudio.
  • git add, commit and push
  • check your note has been added in

Publishing in the internal notebook

  • If we don’t want to make the post publicly available, we should use the with the repo at

Moving posts between different websites

  • To move posts between websites (,,, etc) just move the specific folder under contents/post. For example, move the folder with all its contents in ~/Github/web-internal-notes/content/post/2020-10-29-first-note-hki/ to ~/Github/web-lab-notes/content/post/2020-10-29-first-note-hki/ or vice versa. When in doubt, publish first on the internal repo.

Large data should be posted in Box

When running analysis, data should be placed in Box not under the githup repo. Add block as shown in the next block, which will automatically create a folder with the same name in the relevant Box data folder.

Add the following to every new post in Rmd

PRE = "/Users/haekyungim/Library/CloudStorage/Box-Box/LargeFiles/imlab-data/data-Github/web-data"
##PRE="/Users/margaretperry/Library/CloudStorage/Box-Box/imlab-data/data-Github/web-data "
SLUG="correlation-between-ptrs-and-rat-height-bmi" ## TODO copy the slug from the header
bDATE='2022-07-07' ## TODO copy the date from the blog's header here
DATA = glue("{PRE}/{bDATE}-{SLUG}")
if(!file.exists(DATA)) system(glue::glue("mkdir {DATA}"))

## move data to DATA
#system(glue::glue("cp {tempodata} {DATA}/"))
system(glue("open {DATA}")) ## this will open the folder 

Netlify is hosting the content here

© HakyImLab and Listed Authors - CC BY 4.0 License