This repo contains two macOS workflows used to simplify adding images to blogposts on hjerpbakk.com.
- Create hjerpbakk.com img folder. This will create a hjerpbakk.com image folder with the same name as an image and move the image into the new folder.
- Create hjerpbakk.com image snippet. Given that an image is in its correct folder, this snippet will create images fitting predefined breakpoints and put the image snippet on the pasteboard, ready to be pasted in the post's Markdown source. The images will also be minified.
The flow is usually to rename an image to the name of the post, then run script number 1. Then move more images if needed to the folder created by script 1, then run script 2 on them. Remember to paste the snippet into the post between each run.
The generated HTML snippet supports both lazy loading and a lightbox.
On a clean install of macOS, do the following.
- Install ImageOptim for maximum minification.
- Install pip:
sudo easy_install pip
- Install PIL through pip:
sudo pip install pillow
- Open the two workflows and choose
install
.
Right click an image and choose any of these two services.