To contribute to the Open Science Labs blog, you should first fork the repository and clone it locally. Follow these steps to set up your local development environment:
# Clone your fork of the repository
$ git clone https://github.com/MY-USER-NAME/opensciencelabs.github.io
$ cd opensciencelabs.github.io
# Add the original project as an upstream remote
$ git remote add upstream https://github.com/opensciencelabs/opensciencelabs.github.io
$ git fetch --allNote: Replace MY-USER-NAME with your GitHub username.
Set up the Conda environment to manage the dependencies for the blog:
# Create and activate the Conda environment
$ mamba env create --file conda/dev.yaml
$ conda activate osl-webThis will create a new Conda environment named osl-web with all necessary
dependencies and activate it.
- Previewing Changes: Use
makim pages.previewto run a local server for previewing the blog and other pages. - Building the Site: Before pushing changes to GitHub, build the site using
makim pages.buildto ensure everything is compiled correctly.
-
Prepare the Blog Post:
- Navigate to
pages/blogand create a new folder with a slugified version of your blog post's title. Use https://slugify.online/ to generate a slug. - Inside this folder, create your blog post file:
- For Markdown:
index.md - For Jupyter Notebooks:
index.ipynb(use Jupyter Lab to create this directly)
- For Markdown:
- Navigate to
-
Include a Header Image:
- Place a header image (either
header.pngorheader.jpg) in your blog post folder. Make sure the image is under a free license.
- Place a header image (either
-
Markdown Posts: Add a metadata block at the beginning of your
index.mdfile:--- title: "Title of Your Blog Post" slug: "slug-of-your-blog-post" date: YYYY-MM-DD authors: ["Author Name"] tags: ["tag1", "tag2"] categories: ["category1", "category2"] description: "Short description of the blog post." thumbnail: "/header.jpg" template: "blog-post.html" ---
-
Jupyter Notebook Posts: The first cell of your
index.ipynbshould be inrawmode containing the same metadata as above.
- Building and Viewing:
- If using a Jupyter Notebook, run
makim pages.buildto convert the notebook into a Markdown file (index.md). - Add the generated
index.mdto your repository as it will be used to render the webpage.
- If using a Jupyter Notebook, run
Before submitting your blog post:
- Ensure all files are added to your repository.
- Submit a pull request to the main
opensciencelabs.github.iorepository for review.
Thank you for contributing to the Open Science Labs blog!