Upon reopening, RStudio will recognize the project as a website.Ī blogdown site is a bit more cumbersome both to build and to host on GitHub as compared to a regular R Markdown website, and as compared to what I described above. This will generate all of the file structure for your new blog.Īfter this is complete, you should quit and then reopen the project. Below “user/repo” refers to the GitHub username and GitHub repository for your selected theme.īlogdown::new_site(theme = "user/repo", theme_example = TRUE) The option theme_example = TRUE will obtain the files for an example site that you can then customize for your needs. Within your project session, generate a new site. In this case themes aren’t quite as easy to change as with basic R Markdown websites, so choose carefully. Add an R Project to the local directoroyĬhoose a theme and find the link to the theme’s GitHub repository.Clone the GitHub repo to a local directory with the same name.Create a GitHub repository named YOUR_GH_, where YOUR_GH_NAME is your GitHub username, initialized with a README file.The first three steps are similar to those from creating a basic R Markdown website: Would also build pages for any available vignettes.Each function can be clicked through to see the help page, if any.The Reference page of the site lists the included functions with their description.The Home page of the site will be pulled from the README file on your package repository.The page will be added as to your personal website as YOUR_GH_/repo_name Select “master branch/docs folder” as the source and hit Save
![rmarkdown link rmarkdown link](https://i.stack.imgur.com/WfnIN.png)
In the GitHub repository for your package go to Settings > GitHub pages. Upload/push these changes to the GitHub repository for your package
![rmarkdown link rmarkdown link](https://rlesur.github.io/meetup-r-nantes-rmd/assets/rstd.png)
This will add a folder called docs to the local directory for your package This assumes you already have an R package with a local directory and a GitHub repository.įrom within your package directory run: devtools::install_github("hadley/pkgdown") Details of pkgdown can be found on the pkgdown website, which was also created using pkgdown. Use Hadley Wickham’s great package pkgdown to easily build a website from your package that is hosted on GitHub. Now your local directory contains all of the files needed for your website:Īnd here’s what the resulting website looks like, hi kitties!Īn example from the website for my package ezfun: Once you have your content written and the layout setup, on the Build tab in RStudio, select “Build Website”: In this example the image files are stored in a subdirectory of YOUR_GH_ named “files”. Rmd files that contain your website content, which will produce the html pages of your website when you knit them.įor example, the index.Rmd file for my cats’ personal website homepage looks like this:. Themes are easy to change even after you have added content.įor example, the _site.yml for my cats’ personal website looks like this: name: "cat-website"Ĭhoose a default theme from for easy implementation.Įdit and create.
![rmarkdown link rmarkdown link](https://community.rstudio.com/uploads/default/original/3X/c/3/c332f147df86b5b8ad3b2cfa9262af883fb32fb7.png)
Preview Jekyll themes here and play around with different options. Edit the _site.yml file to change the metadata, layout, and theme of your website.