Skip to content

GetStarted

Kevin Cazelles edited this page Feb 5, 2023 · 2 revisions

In this section we explain how to run the blog locally.

Installation

This blog is created with blogdown that basically use Hugo and Rmarkdown to generate a blog (see 'blogdown: Creating Websites with R Markdown' for more details). To build the website, on top of blogdown, several packages are required, they are listed in the DESCRIPTION file. One quick way to install those packages is to use the remotes package. First, clone this repository

git clone https://github.com/inSileco/inSileco.github.io.git

then open an R console with the root of the website as your working directory, then do

install.packages("remotes")
remotes::install_deps()

If you don't have Hugo install, then do

blogdown::install_hugo()

Some icons available via the icons are also required, to use them, do

icons::download_fontawesome()

Deploy the server

You should be ready to go now, that said, a few checks would help you find if something is wrong with your installation.

blogdown::check_config()
blogdown::check_content()
blogdown::build_site()

Once you are done, you can serve the blog like so

# this command is verbose and run in the background
blogdown::serve_site()

Workflow

  1. Make sure you have the last commit of the main branch of the inSileco.github.io repository;

  2. Create a new branch, a name that reflects your post is better, e.g. git branch yourpost;

  3. Switch branch: git switch yourpost;

  4. Run the server locally (see above);

  5. Work on your post:

    • to create a new empty, use blogdown::new_post('MY_TITLE'); alternatively, use do hugo new post/yourpost.Rmarkdown in a console which will use the archetype post.Rmarkdown;
    • check the writing guidelines in the Contributing section;
    • if any changes are made on one of the source files, the site will be auto-generated and changes will be displayed at the localhost address (e.g. http://127.0.0.1:4321), so you can locally visualize the final rendering.
  6. Once you are done with your changes, commit and push your changes (push your branch yourpost on the GitHub repository);

  7. Open a Pull Request (PR) and assign a reviewer;

  8. Opening a PR will trigger a GitHub Actions workflow that will check the blog on the three main platform.

  9. Once your post is reviewed and the build is passing, the reviewer (that might be yourself) will be able to merge your post (for a post, if there are several commits, a squash and merge is preferred);

  10. Once the PR is merged, do not forget to pull the dev branch for your next post!