Jack Baty Daily

Daily notes from Jack about everything

Easier handling of post images

Easier handling of post images

One point of friction when blogging with static site generators is getting images where they belong. I did something about it this morning in Tinderbox.

Each post already has an Image attribute for setting the path to the post's image. What I've added is a Stamp to copy a file from wherever it is into the correct directory in my site's folder. At the same time, it sets the Image path for me.

All I need to do is drag an image from the Finder into the File attribute of a post, run the Stamp, and I'm done. Here's the action code I used in the "Import Post Image" Stamp.

All it does is process some strings to create paths and calls out to the terminal 'cp' command, then sets some of the note's attributes. I'm sure I'll improve this over time, but this has already smoothed the way to adding images to posts here.

✍️ Reply by email