I love this quote by John Cutler from his post on disincentives.
“Good things can happen when you make it easier to do good things.” –John Cutler
He advises to focus less on incentivizing desired behavior, and more on removing disincentives from desired behavior. It’s brilliant.
My desired behavior is to write more posts on my Hugo blog.
I like Hugo because it’s free, fast, and fun to develop. But look at all these hurdles I had to jump when publishing!
- Open a terminal
- Type
hugo new posts/my-interesting-post
- Remember 👆 syntax since I don’t do it frequently
- Open the new file in a markdown editor
- 🌟 WRITE THE WORDS (desired behavior)
- Back to the terminal
- Run
hugo serve
to preview - Open up the browser
- Navigate to
localhost:1313
- Back to the terminal to
git add .
git push
- Thankfully, Netlify will automatically deploy on push
Here’s how I removed all that friction.
macOS Shortcuts
I used the macOS Shortcuts app to automate the steps above. Then I put the shortcut icons in my dock for a “one-click” experience.
Here’s my new workflow.
- One click to start writing a new post.
- One click to preview it a browser.
- One click to publish.
It Worked!
I’m writing much more now that I’ve got these buttons. Here are screenshots showing you how to set these up for yourself.
1. ‘New Post Bundle’ Shortcut
What's going on here?
- The first action prompts me for the title text
- Then the second action has my response in the $1 variable
- Change directory in my blog
- Run
hugo new posts/$1
- Open my markdown editor iA Writer
Notice I had to write the full path to the hugo
binary. Not sure why.
2. ‘Preview Blog’ Shortcut
What's going on here?
- First I kill all exisiting
hugo
processes - Change directory into the blog
- Run
hugo serve &
putting the server process in the background 4. Then I open localhost:1313 in the default browser
3. ‘Publish Blog’ Shortcut
What's going on here?
- Changes directory into blog
- Git add everything
- Push it to main
Is there an app that makes confetti fall from the top of the screen? That’s the missing piece of this shortcut.
Video Demo
To see this all in action, here’s a video of me creating, writing, and publishing this exact post that you’re reading!