When I look at popular tools for writing blog posts, they all seem to require an ungodly amount of work to get common things done. They mostly all get the basics right: You can just type away at a text, and then post it. Easy peasy. Sometimes it loses your work, but that’s modern computers for you.
But blogging is more than just typing: You have to link to other posts, you have to include images (both your own and from the web), and you may even have to add some videos.
And all those things are usually annoying chores, involving way too many steps. (Admittedly, I have not experienced professional systems for editing WordPress, and perhaps they’re really good? Or perhaps I’ve missed your favourite tool?)
So in this blog post I’m going to explain that Emacs (with the Emacs for WordPress (ewp for short)) package is, like, the best. For nerds. Not for normal people. I mean, it’s Emacs.
OK, first the basics. The editing stuff comes later.
You say M-x ewp and you get this basic buffer:
Yes, it just lists your blogs. Hit RET on a line, and you get the posts:
Wow, I’ve really been reading lots of books lately… Anyway, there’s commands like M to list media on the blog:
In this buffer you can do common stuff like uploading images and videos, rotate images, rescale videos and all that stuff.
Back to the main view, there’s the C command that lists comments:
Here you can do the usual stuff, like trashing spam comments and responding to comments.
OK, get the drift? The basic admin stuff is like any other WordPress interface, only more Emacsey.
So let’s look at editing. The basic premise is that ewp just edits WordPress posts just as they are: That is, as HTML. There’s no special format (or formatting) used, and this is important: This means that you can edit WordPress posts with any tool you like. So even if you’re mostly composing your blog posts with ewp, you can still edit them using the WordPress mobile app, for instance.
But at the same time, when using ewp, you’re using Emacs with the security that this entails: You’ll get undo and auto-saves locally, so you’re never in the danger of losing your precious prose (which is a real problem with some other WordPress interfaces).
Anyway! A very common thing to do is to quote some text from a web page:
The point here is that ewp inserts not only the quoted text as a blockquote, but it also inserts the link to the page the text was on, and puts the cursor at a convenient point for further editing.
Or you may want a shorter quotation:
Again, both the quoted text and the URL in one fell swoop.
Most interfaces have a convenient way to just paste in images you’ve found on a web page, but then they make you go through a pretty tedious process to do extremely common things like cropping and rotating images. In ewp, it’s trivial:
And here’s that cropped and rotated image:
And this should be obvious, but I feel I have to mention it explicitly, because many tools fail here: If you put an image in an ewp edit buffer, it will be uploaded to your blog automatically: Absolutely no manual work involved.
Another common thing to do is to have a link to an image and you want to put that on your blog. However, hot-linking images to a site owned by somebody else is something you shouldn’t do, not only because the images will often disappear, but it’s rude, bandwidth wise. So:
ewp downloads the URL, and then uploads it to your own media library automatically.
From the screencasts included above, you may have guessed that ewp has a number of commands for dealing with video, too. Unfortunately the video support in Emacs (or at least the version of Emacs I’m using; I don’t know from modern versions) is somewhat lacking. ewp does the basics: It allows you to put <video> elements into your post, and it automatically creates and uploads “poster” images that are used by the web browser as placeholder images.
It also (optionally) resizes the videos, and converts (using ffmpeg, of course) the images to an mp4 format that browsers understand. (This is a pretty common problem — many things that create video files, and even mp4 video files, create files that web browsers can’t play natively.)
But writing blog posts isn’t just all about stealing content from other web sites. I mean… creating meaningful links to other creators in the world. Widely.
Sometimes you have to steal content from movies, too.
ewp can watch directories for incoming images and inserts those images automatically into the post you’re writing. That can be used in a number of ways — when I’m watching movies, this is basically my workflow:
Whenever I see something interesting, I just tap a special key on that little keyboard that I have next to me, and that tells the mpv that’s running on a machine in my bookshelf to take a screenshot, and then that’s rsynced to my laptop there, and then the image appears as if by magic:
And also nicely cropped automatically — that’s actually a somewhat complicated thing to do in a sensible way, because you should have a reasonable number of screenshots to determine what the “real” format of the movie is. There may be very dark shots, and you don’t want those to be suddenly blown up ridiculously… Hm, looking at the image above, it doesn’t look like a perfect trim, actually — looks like a kinda janky transfer to DVD.
Sometimes you just have to take a picture yourself, and Emacs helps with that, too:
I’ve mentioned this before, but I’m using a camera that uploads things automatically to my laptop, and then ewp finds it and:
Since this is Emacs, there is of course a gazillion more commands to deal with editing and publishing blog posts, but I think those are the main things that I’ve been annoyed by and fixed over the years. Editing something that looks like this in Emacs:
Is way more fun than traipsing through some 95 click interface for doing anything.
Blogging can be fun! At least if you find Emacs fun.