Editing the Lab Website
Cloning the Website Repository
First, fork the website repository to your own GitHub account. Then, clone your fork to your local machine and create a new branch. It’s recommended to work on a branch rather than the default main
branch to keep your changes organized.
One-Time Setup
To get started, follow these steps for the initial setup:
Install the
blogdown
R package:install.packages("blogdown")
Install Hugo:
blogdown::install_hugo()
Create a New R Project: Open RStudio, navigate to your local copy of the website repository, and create a new R project in that directory.
Adding New Members
To add a new member to the website, follow these steps:
Create a Directory: Create a directory named
content/authors/first-lastname/
.Add an Avatar Image: Place an avatar image file named
avatar.jpg
in the directory:content/authors/first-lastname/avatar.jpg
.Create and Customize an
_index.md
File: Copy an existing_index.md
file fromcontent/authors/
into the new directory and customize it with the new member’s details:cp content/authors/existing-author/_index.md content/authors/first-lastname/_index.md
Viewing Your Changes Locally
To see your changes in real-time on your local computer, follow these steps:
Open the R Project: Open your R project in RStudio.
Serve the Site: Run the following command in the R console:
blogdown::serve_site()
View in Browser: The site will appear in a pane within RStudio. Click the
Show in new window
button to open it in your web browser. The site should update automatically as you save files, though it may take a few seconds to reflect changes.
Submitting Your Changes
When you’re ready to submit your changes, follow these steps:
Create a Pull Request (PR): Push your branch to your GitHub fork and create a pull request to the original repository. This will allow others to review your changes.
Netlify Deployment Preview: After creating the PR, Netlify will automatically provide a deploy preview for the website. Check this preview to ensure everything looks correct.
Merge the PR: If everything works fine, the PR will be merged.
After Merging
Once the PR is merged, the website will rebuild automatically. This process may take a few minutes, so please be patient. any issues, don’t hesitate to ask for help.