-
Notifications
You must be signed in to change notification settings - Fork 20
Adding a new blog entry or translation
# Clone
git clone https://github.com/rladies/rladies.github.io.git rladies_website
# Enter
cd rladies_website/
# replace my_branch with any name you like
# will now be working on a copy of the main repo
git checkout -b my_branch
Open the folder in RStudio.
install.packages('blogdown')
Use the blogdown addin in RStudio to create a new post.
Addin
-> New post
Fill inn the fields with the relevant information.
We are going to follow a few rules to set the header of the post to set posts easily discoverable.
- Title: Post title. It is the main feature, it shows in the list and the post page.
- Author: Post author. It is not visible in the moment. We will work to make it visible and to show in a menu.
-
Date: Post date. Same as author. The date must be static, nothing like
r Sys.Date()
, otherwise everytime the blog is generate a new date is set in the blogpost. The format must be YYYY-mm-dd. - Description: Post subtitle. As an example, we used it to set the title of the post series of the 2018 IWD project. It shows in the posts list and in the post page.
- Tags: Post tags. They should include meaningful information like date if it is a recurrent project (because dates are not shown anywhere for now). 4 or 5 tags is a good number. Tags.
- Categories: Post categories. Like tags but the theme is more general. They are not visible right now. Categories.
All of the information will be shown in the post yaml, and can also be edited later.
Example:
---
title: "1. Behind the scenes of R-Ladies IWD2018 Twitter action!"
author: "R-Ladies"
date: "2018-03-26"
description: "Part 1: Ideation and Creation!"
tags:
- iwd
- twitter
- part1
- 2018
categories:
- IWD
- R-Ladies
---
Your post will be created in a folder within content/blog
and you can add all the files you need for you post here.
Any images, data files or other things you need to include in your post, add them directly in the folder.
As you write you post, remember to knit
your post so have a look at how it looks like!
The blogdown site will use the markdown file created from your knitted Rmd
on the site, not your Rmd
itself.
You can preview the entire site with your post with blogdown::serve_site()
.
Once your post looks as you want it to on your local machine, it's time to get it online! In the RStudio git pane, add your post folder, commit with a message, and push it online!
You can also do this in the terminal in RStudio
# Add the post
git add content/blog/2020-01-01-my-post
# Add a commit message to the post
git commit -m "my commit message"
# Push changes online (replace my_branch with your branch name)
git push --set-upstream origin my_branch
Once you have pushed your changes online, make a Pull request (PR) to the main branch. If you are not a member of the R-Ladies Global team, you will be working on a "fork" of the repository.
When the PR is open (see here), a person from the blog or website team will be assigned as your reviewer and will take you through the remaining process.
When working on a fork, the build of the website will run, but no preview will be created.
After the PR is received, someone in the @rladies/blog or @rladies/website team will have a look at your post. They will request changes through GitHub code review, where you will need to adapt or accept the changes they propose to your document.
Once the team is satisfied with the post, they will create a new branch from the main repository and call it something like "fork_[newpostname]", and then switch your PR's base branch to the newly made fork rather than main
.
They will then merge your PR into this branch, and wait for a preview to be generated.
Ideally, at this point, only other changes that might need to be done are editorial and up to the @rladies/blog or @rladies/website team to fix. They will ask for you assistance directly if anything else is needed.
Hugo setup
Contributing