Our blog#
The blog at 2i2c.org/blog is the primary way that we communicate our work to the external world.
See Marketing goals and strategy for how the blog fits into our communications strategy.
Where is the blog hosted?#
Our blog is a subset of our website repository for 2i2c.org. See the blog README for more explanation.
How to create a blog post issue#
Click here and fill out the template as quickly and as best as you can. Don’t worry about getting it perfect.
How to write a blog post#
Follow the blog post guide here.
How to preview your blog post#
Note: you don’t actually need to preview the post if it’s too much hassle. Just make a PR and the GitHub PR preview can be used to see what it looks like.
To preview your post locally:
Make sure you’ve saved the post to disk.
Ensure that the date of the post is before today’s date, otherwise the post won’t show up (if the post will go up in the future, just temporarily make the date earlier to ensure it shows up)
Run
hugo serve -Dfrom the repository root
This will run a server that can be used to inspect your post.
How to edit the blog in the browser without doing anything locally#
The easiest way to do all of the above without ever leaving the browser is to do the following:
Go to https://github.dev/2i2c-org/2i2c-org.github.io/ this will open a VSCode instance in-browser with the repository loaded up.
Alternatively you can do this from the GitHub UI by going to a repository and pressing
.
Create a new branch that will track your changes by clicking the buttons below and typing in a new branch name:
Follow the steps above (you won’t be able to preview, don’t worry about that).
When you’re ready to propose a new change, click the “changes” tab, and then the “commit and push” button.
Follow the prompts to create a new pull request from within VSCode, or navigate to 2i2c-org/2i2c-org.github.io and open the PR from there
How to optimize images#
Optimizing images saves space in our repository and in traffic load times.
The oxipng tool is one that we’ve used here.
These are brief instructions to get it working based on the oxipng instructions.
It is written in Rust, so you’ll need to install cargo, install oxipng, and then run it.
To Install Cargo, follow the Cargo installation steps.
This will install both Rust and Cargo.
On Windows and Mac, it should be something like:
curl https://sh.rustup.rs -sSf | sh
One you have done this, you can either run oxipng manually or via pre-commit.
Both are described below.
Run oxipng with pre-commit#
If you have pre-commit installed in this repository, it will run oxipng on any .png files that have been added automatically.
Simply cd into this repository root, then run:
$ pip install pre-commit
$ pre-commit install
Now when you commit a .png file, oxipng will be run.
Run oxipng manually#
To run oxipng manually, follow these steps:
Install
oxipng. Usecargoto installoxipng.cargo install oxipng
Run the optimization on our images. This one uses several sensible options and will optimize any image in the repository.
oxipng -o 4 -i 1 --strip safe --recursive content *.png
Once the images are optimized, re-commit them to the repository and push the changes.