Hugo From Shortcuts
It took a little work, but I managed to get iA Writer, Working Copy, and Shortcuts to play nice and create a new Hugo post on mobile. I’d toyed with the idea of adopting dynamic APIs that mutated a checkout of the site and such but there was always some extra difficulty and the whole point of going static was to avoid that nonsense.
The short of it is:
- Ask for Text with “Post Title”
- Current Date
- Format Date (Current Date, ISO)
- Text (your stub post goes here, frontmatter and all)
- Replace “[^\w\s]+” with “-” in “[step 1]”
- Change “[step 5]” to “lowercase”
- Format “Current Date” as “yyyy-MM-dd”
- Set name of “[step 4]” to “[step 7]-[step 6].md”
- Save “[step 8]” to “[Working Copy path to content dir]”
- Open “Saved File” in “iA Writer”