There are many ways to customize your research website. Below are some common options.
workflowr automatically creates many files when the project is first started. As a first step for customizing your site, add the following information:
analysis/index.Rmd
analysis/about.Rmd
analysis/license.Rmd
. See A Quick Guide to Software Licensing for the Scientist-Programmer by Morin et al., 2012 for advice. If you’re ambivalent, the MIT license is a standard choice.The theme is defined in the file analysis/_site.yml
. The default is cosmo, but the rmarkdown package accepts multiple Bootstrap themes. These are listed in the rmarkdown documentation. Go to bootswatch.com to compare the bootstrap themes. When typing the theme, make sure it is all lowercase (e.g. spacelab, united, etc.).
When experimenting with different themes, you’ll want to build a fast-running file, e.g. likely analysis/index.Rmd
, instead of rebuilding the entire site every time. Click the RStudio Knit button or run wflow_build()
in the R console to preview each theme:
wflow_build("analysis/index.Rmd")
Once you have chosen a theme, update the website by running the following:
This commits analysis/_site.yml
, re-builds every previously published HTML file using the new theme, and commits all the republished HTML pages.
Using the https protocol to communicate with GitHub is tedious because it requires entering your GitHub username and password. Using SSH keys for authentication removes the password requirement. Follow these GitHub instructions for creating SSH keys and linking them to your GitHub account. You’ll need to create separate SSH keys and link them each to GitHub for each machine where you clone your Git repository.
After you create your SSH keys and add them to your GitHub account, you’ll need to instruct your local Git repository to use the SSH protocol. For a hypothetical GitHub username of “myname” and GitHub repository of “myproject”, you would change the remote “origin” (the default name by convention) using the function wflow_git_remote()
:
wflow_git_remote(remote = "origin", user = "myname", repo = "myproject",
protocol = "ssh", action = "set_url")
Alternatively you could update the remote URL using Git directly in the shell. See this GitHub documentation on changing a remote URL for instructions.
The default function used to report the session information is sessionInfo()
. To change this, you can edit this setting in _workflowr.yml
. For example, to instead use devtools::session_info()
, add the following line to _workflowr.yml
:
sessioninfo: "devtools::session_info()"
If you’d prefer to manually insert a more complex report of the session information, disable the automatic reporting by adding the following to _workflowr.yml
:
sessioninfo: ""
Note however that workflowr will still check for the presence of a session information function. Specifically it expects to find either sessionInfo
or session_info
somewhere in the R Markdown document.