This website is built with blogdown, and hosted on Netlify. This means that it’s possible to add both markdown and RMarkdown content to this site. Below, I’ll highlight some of the structure of this site and how to contribute the different types of content.
When you want to add a page, you will add it to the
content/ directory. This
contains the structure of the website where each section displayed on the right
is a folder with an
_index.en.md, which is the homepage for that section and
any number of other pages to be displayed. All pages should have a yaml header
--- title: "New page for R4EPIs" weight: 15 ---
weight parameter determines where in the list this page will fall. Smaller
numbers will appear above higher numbers.
More details about customization are found in the learn hugo theme documentation.
You would use this option if you are contributing a document that doesn’t contain any R code examples or only contains simplistic examples. This would include tutorials, FAQs, and other descriptive material.
If you want to contribute a markdown document, you can fork the repository, create a new branch, and edit a new document on github. After you are finished editing, you can create a new pull request and the website will be tested on the netlify servers. You can also follow the instructions for contributing an RMarkdown document if you want to have a live preview on your computer.
You would use this option if you were contributing a document that contains R code examples that need to be displayed (for example, demonstrating some of the functionalities of the sitrep package).
This has a slightly different process than contributing markdown documents
because Netlify cannot run R code, so you must do this on your own computer.
To contribute an RMarkdown document, first fork and clone the repository to your
usethis::create_from_github('R4EPI/r4epis-website', fork = TRUE). This
should open a new RStudio project with this website inside.
Next, make sure you have the blogdown package installed with:
install.packages('blogdown', repos = "https://cloud.r-project.org") # ensure that hugo is installed blogdown::install_hugo()
Now you can ceate a new RMarkdown document inside one of the folders by using:
blogdown::new_content("<folder>/<page>.Rmd", kind = "page")
(be sure to remove the arrows < > when typing your folder and page names.)
This should open a bare Rmarkdown document in a new window. Edit this however you like. When you are finished editing your Rmarkdown document, you must render it with
This will render your document to HTML and then use hugo to display the website. When you are happy with the results, commit your changes, push them to github, and make a pull request.