A reference for future me, on how to create posts.
For the distill blog Medical R, based on the repo at https://github.com/higgi13425/medical_r
in the R project medical_r
and viewable on the web at https://higgi13425.github.io/medical_r/
run in the Console in RStudio
distill::create_post("title-of-post")
this creates a new Rmd document for editing, inside the _posts
folder, and within its own date-title specific folder inside the _posts
folder. You can now edit this Rmd, including the title in the YAML header.
All the usual Rmarkdown features, including embedding code chunks, images, videos, etc.
https://rmarkdown.rstudio.com/authoring_basics.html
here()
package in the setup chunk.knitr::include_graphics(
here("_posts/YYYY-MM-DD-post-name/image-name.jpg or png"))
# spacer comment
Check the resulting HTML in the Viewer window. Repeat steps 2 (Editing) and 3 (Knitting) until you are happy with the post.
Note that you can keep draft = TRUE in the YAML until you are ready to share with the world
Make sure draft= FALSE in the YAML of your post.
Then Knit it to HTML for a final time.
Then click on the Build Tab, and click on Build Website.
Double check that the HTML looks good before Commit and Push.
Click on the Git tab, stage the changed files, Commit them, and Push to Github.
Wait 1-3 min, then refresh the website at Medical R https://higgi13425.github.io/medical_r/
to see the results.
Building the website will not re-knit posts. You have to choose to knit any post that you edit.
For attribution, please cite this work as
Higgins (2020, Oct. 14). Medical R: How to Post. Retrieved from https://higgi13425.github.io/medical_r/posts/2020-10-14-how-to-post/
BibTeX citation
@misc{higgins2020how, author = {Higgins, Peter}, title = {Medical R: How to Post}, url = {https://higgi13425.github.io/medical_r/posts/2020-10-14-how-to-post/}, year = {2020} }