What's Going On Here?
This site has been here for a long time. It's supposed to do two things; be somewhere I can document how to do things which I know I'll forget about later, and also share that with others in case it's helpful. Textpattern has been such a great fit for running the site other the years, because of its search function, and initially because of the editing interface.
But hang on. It can be years between articles. Why is that? It's not like my Notes app isn't filling up with stuff I'm doing, so why does almost nothing make it online?
It boiled down to one simple thing.
I hate writing on Textpattern.
More specifically, I hate writing in Textile, on Textpattern.
That's a problem. Textile is the markup language used for writing articles on Textpattern, and I simply forget the syntax between posting anything. It's a barrier to just throwing information into the system, particularly when the interface isn't a single click away, like the Notes app is.
Nuts. It also made me a bit sad, because Textpattern has worked so well, so reliably, and was conceived "for content publishers to Just Write". I've found it impossible to use for that purpose for years.
Workarounds
These days the Markdown markup language is pretty ubiquitous, so even my Solution Two was thwarted when I considered finding a text editor with a nice interface in which I could write my notes and simply have it barf out the Textile for me to copy-pasta into Textpattern.
I also had delusions of something into which I could drag-and-drop images that would miraculously optimise themselves, save into a custom location and be ready for upload.
If I couldn't do those things, I reckoned I would need to use some new online publishing thing. Throw away Textpattern and redevelop the site (the style of which I still enjoy) in some hosted service. After all, an online editor I actually like to use is the one built-in to Discourse, which does everything I ask of it. But I was not in the mood to deploy a massive forum platform, then mercilessly hack at the thing until it represented a home-cooked weblog.
The closest things I discovered to the writing simplicity I craved were pika.page, Quotion, and Write.as. Pika handled the images the best. Quotion was snazzy because I could just shuffle my Apple Notes around and voilĂ ! Instablog! Write.as has a lovely writing interface, and there's WriteFreely which allows you to self-host. That's awesome.
But customisation? Making-a-varying-number-of-birds-appear-on-the-wires-in-the-background-level customisation? Heck, no. Even editing the damn footer is near impossible on some of these platforms, even when you're paying for them! That's dumb.
You're Holding It Wrong
But wait! What's this?
It's the wet_textfilter_markdown plugin!
In the background, this site is still running on Textpattern, and I'm very happy about that. I've spent a bunch of time simplifying things (sorry, no more support for Internet Explorer 6) and removing the various customisations I'd added over the years.
And now it flippin' works.
Discovering the wet_textfilter_markdown plugin changed the game. Now I was pretty certain I could find a desktop editor that would export or use Markdown natively. Something I could use for note taking on the fly and tidy up later. Maybe even do something with images!
With the terms of my search duly modified, I quickly found Obsidian. It's funny to discover something so hugely supported, which has been out there solving problems for years, and yet I'd never heard a peep about it.
This thing has such comprehensive configuration that I had high hopes it would meet my lofty requirements. I barely know how the thing works, but the plentiful options got it pared down to my level. I then added the community Editing Toolbar and Image Converter.
The Editing Toolbar was a no-brainer given my forgetfulness and limited Markdown experience. The Image Converter is an absolute saviour, able to do all the things I assumed nobody else in the world would be so pernickety to require. Look!
I can specify output paths and filenames with variables! I can add automatic conversion and optimisations! I can take a screenshot and just paste it into the editor. That's it.
Genius.
Barf
And how to get all this onto the site? Surely a tumult of FTPs, SFTPs, WebDAVs, and suchlike?
blw
Three letters in the Terminal. It's in my .bash_functions
file, and it looks like this:
blw() {
rsync -avz --no-perms --chmod=Fu=rw,Fg=r,Fo=r,Du=rwx,Dg=rx,Do=rx --delete --exclude '.obsidian' --exclude '.DS_Store' "/Users/andy/Library/Mobile Documents/iCloud~md~obsidian/Documents/BirdsLikeWires/" andy@birdslikewires.net:/var/www/birdslikewires.net/obsidian/
ssh andy@birdslikewires.net << EOF > /dev/null 2>&1
find /var/www/birdslikewires.net/obsidian/ -type f -exec chmod 644 {} \;
find /var/www/birdslikewires.net/obsidian/ -type d -exec chmod 755 {} \;
EOF
open https://birdslikewires.net/obsidian
}
That "Mobile Documents" path is where Obsidian hooks into iCloud, meaning I can switch over to write on an iPad and have things stay in sync. Fantastic.
And that's a pasted screenshot following all the same conversion and path rules as on the desktop. Kaboom.
Type those three letters, hit return, and the content gets uploaded to the obsidian directory on the server and it opens in the browser, ready for me to copy-pasta that Markdown text straight into Textpattern.
Images work because there's a symbolic link called assets
in the web root, pointing to the obsidian/content
directory. That keeps the relative paths saved by Obsidian happy.
And How Is It?
No idea!
It's very late, I've just written this, and I'm going to type those three letters in a second to pop everything online. I'm still in the midst of a gentle site remodelling, with my eye on full-content RSS / ATOM support. I know my website style won't be for everyone, but I'd still like to give people access to the content if they'd like it.
Who knows, maybe now I'll have more motivation to get those notes out into the world. Feels like the web could do with some more independent bobbins on it.