2024-09-12
Using the right tool for the job: Website coding, site management and blog posting from the iPad
These past few days I've had a fantastic time building up some new workflows as I've reorganized the site. My primary toolset for writing, coding and publishing websites is Textastic, iA Writer, Shortcuts, Files and File Explorer.
A few notes on the tools and the process!
The initial motivation for this particular post was my coming to grips with the hard-for-me to accept fact that I had to resort to using my Mac for a task yesterday. I can't think of the last time that this happened. I suspected that it would happen in the course of this project.
Back in my Mac using days seven long years ago I often relied on Panic's app Coda or, before that, BBEdit. Both of those apps allow for search and replace across all files in a folder. Over the past week I've begun populating some of my back posts, currently around 60+ html files. But of course it's after that that I add new pages to the site and now need to change the Nav bar at the top of the pages. Predictable and I'm sure there will be other such changes over time.
So, now I've got a few lines of code to change in 60 files. I also realized I'd also neglected to put in the name of my site under the logo. Textastic can find text across a folder of files but does not bulk replace across those results.
Rather than go through each of the files in Textastic pasting in my changes I downloaded BBEdit on the Mac. I opened the folder of html files from iCloud. Searched. Replaced. Saved. The task was done in a few seconds instead of 20 minutes or more. I'm stubborn but I'm not that stubborn. This kind of site wide search and replace is essential and to my knowledge there's no text/code editor that will do it on an iPad. I've put in a request to the developer of Textastic and hope he adds the feature. He generally seems very responsive and Textastic is always updated with improvements so it's not unrealistic to hope! Until then, I've reconciled myself to using BBEdit on my Mac for this particular task as it comes up.
Where the iPad and my usual apps continue to get the job done
Textastic
Aside from the above mentioned gap, Textastic continues to be my most used app for writing and coding. In my mind it's always been "BBEdit for the iPad". At least in my use case it has been a complete replacement.
- Code completion and support for Emmet expansion
- Tabs for opening an unlimited number of files
- Ability to open folders/files from other apps
- Customizable keyboard shortcuts
- A variety of themes and fonts to choose from
- Preview of html/markdown files in app as well as in Safari
- An excellent built in SFTP/WebDAV client
- SSH terminal which is feature I don't use but thought I'd mention because it's an important feature for some
Most of my writing starts in Textastic, usually in the OBTF(One Big Text File). When I've got a post ready to go I use a Shortcut to save selected text as a Markdown file. From there I hop over to iA Writer to open the new file and do a read-over and edits. At this point, if I've got a photo to insert into a post I'll hop over to the Photos app, select the photo then share it via a Shortcut that saves an optimized jpg and copies the Markdown code for the jpg to my clipboard ready to paste.
iA Writer
I use iA Writer as a companion app to Textastic. I've tried a handful of others but iA Witer never leaves my dock. I open the file and put it into preview mode to read the post. One of the my initial reasons for using iA Writer was its publish to WordPress feature. Then I switched to micro.blog and it also had a publish to micro.blog feature. Now I'm not publishing to either of those but, as it turns out, there is yet another feature that is filling a similar role. After reading and editing in iA Writer I use the Copy as HTML feature found in the share menu at which point I run another Shortcut.
Shortcuts
In the context of my blogging workflow I currently have five or six Shortcuts that run different processes. Picking up from iA Writer, after I've copied my markdown as html I activate Spotlight and run a publish shortcut which takes the html in the clipboard and inserts it into the full html template for a blog post and prompts me with a dialog to name the file and it's saved into the designated folder ready to be uploaded to the server.
File Explorer and Files
Ideally I would just hop back into Textastic and upload directly from there. Unfortunately my web host is a bit finicky about uploads. Sometimes file transfers from Textastic work, other times not. My work around is to just use File Explorer which never fails. I keep it open along side of the Files app in a permanent work space. I hop over and drag the new html file into the appropriate folder on the server. As it turns out the developer of Textastic is aware of the bug. It's a problem outside of his control and his app but he provided me with a work around so I'm now happily uploading new or updated files directly from Textastic. I hop into Textastic to add the post to my home page and posts page then upload those. Still nice to have File Explorer as a backup should I need it!
The last step is to add the new post to my RSS feed. I open the new post in Safari to read through it for any last minute typo checks. Assuming all is well I select/copy the headline and first few lines of text then share to a Shortcut which wraps the selected text into a new RSS entry and opens up my xml file in Textastic. I paste, adjust the time then upload. Done.
So, several apps connected by Shortcuts automations. It's a fairly easy and flexible process I can modify as needed.