13.7 Workflow

  • Workflow
    • Open the RStudio project for the site.
    • Start the Hugo server using blogdown::serve_site() (only once due to the magic of LiveReload).
    • View site in the RStudio viewer pane, and open in a new browser window while I work.
    • Select existing files to edit using the file pane in RStudio.
    • After making changes, save if a plain .md file, or if working with an .Rmd or an .Rmarkdown document, knit to preview! You can now use the Knit button to knit to the correct output format. You can also use the keyboard shortcut Cmd+Shift+K (Mac) or Ctrl+Shift+K (Windows/Linux).
    • The console will detect the change (it will print Change detected, rebuilding site.), the viewer pane will update, and (in a few seconds) your local view in your browser will also refresh. Try to avoid hitting the refresh button in your browser.
    • When happy with changes, add/commit/push changes to GitHub.
    • Having blogdown::serve_site running locally with LiveReload is especially useful as you can immediately see if you have totally screwed up. For example, in editing my about.md file, this error popped up in my console after making a change and I was able to fix the error right away:
  • If you want a featured image to accompany your post and show up on your listing page (the clickable list of all your posts), you’ll want to add an image with the word featured in the filename: