Jul 11th, 2021 • 3 min read
The posts and pages of this blog live as markdown files in a git repository. Whenever I add or update a markdown file, the site and its static pages are rebuilt.
Here's the problem. I want publishing to be seamless. I don't want to think about git or committing files when adding or editing a blog post. I don't want to switch from markdown editor to terminal or git tool. I want to write, save and see changes live on site without friction. Typically you'd do that on a publishing platform or CMS, most likely through a web interface.
I often collect links, thoughts, pieces of information that I'd like to include in a post. This happens throughout the day, ad hoc when I don't have the time to organize them. The next best thing is to drop the links or notes into the place they end up in - the post itself.
I'm looking for something simple, publishing straight from the app I have always open - my notes app.
Then I found Nota.md. The developers call it Pro writing app designed for local Markdown files. What caught my attention was its Command Pallet feature – the ability to run arbitrary commands within the app.
A few niche things I'd like the app to do:
Nota seemed to tick the right boxes.
Here's how I publish with Nota.
After installing Nota, hit
CMD+Shift+P and choose
Create New Custom Command.
This creates and opens a new file from
First, let's rename the command:
mv .nota/commands/my-command.sh .nota/commands/publish-to-git.sh
Edit the content of that file with the following:
#!/bin/bash # @parameters workspace file cd $1 && git add $2 && git commit -m "Update via Nota" --allow-empty && git push
Here's what this snippet does:
Now, whenever you have a file open, you can hit
CMD+Shift+P and search for "Publish to Git".
Also - "A" and "M" tags in the notes list indicate whether files are new or modified in git.
Tada! 🎉 This is now my favourite way to write and publish to git.
Is there a tool or workflow I haven't considered? Let me know on Twitter!
Want to be notified of future posts? Subscribe below or follow me on Twitter.