Skip to content

A workflow for macOS which takes an image and returns the HTML snippet needed to both lazy load the image and gives the user an option to use a lightbox.

License

Notifications You must be signed in to change notification settings

hjerpbakk/get-image-snippet-workflow

Repository files navigation

Get Image Snippet Workflows

This repo contains two macOS workflows used to simplify adding images to blogposts on hjerpbakk.com.

  1. 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.
  2. 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.

Installation

On a clean install of macOS, do the following.

  1. Install ImageOptim for maximum minification.
  2. Install pip:
    sudo easy_install pip
  3. Install PIL through pip:
    sudo pip install pillow
  4. Open the two workflows and choose install.

Usage

Right click an image and choose any of these two services.

About

A workflow for macOS which takes an image and returns the HTML snippet needed to both lazy load the image and gives the user an option to use a lightbox.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages