How I drafted (okay, wrote) an entry in public by accident

January 16, 2013

Since I tweeted about this recently, I might as well explain myself.

Sometimes there are small drawbacks to the perpetually popular file based approached to blog engines. One of them is the question of how you handle draft entries, ie entries that you're in the process of writing and that you aren't yet ready to publish. The hairshirt approach is to not do anything about them at all; your blog is only for published entries and you have to write drafts entirely outside of it. This is simple but has one to three drawbacks, depending on whether or not you write in HTML.

If you write in HTML, it only has the problem that links to other entries you've written probably have to use a totally different style in your draft than what would be ideal in a published entry. How much different depends on where you draft and preview your entry. If you write in a simple markup language you also have the problem of how you render your draft into HTML form (a job that the blog engine usually does for you one way or another). If you write in a wiki-language that has short names for links within your site you may have a third problem of getting those links to resolve properly in the rendering process.

Thus it's very attractive to have a private area of your file based blog where you can write drafts 'inside' the blog. This handles the rendering (if necessary) and displaying for you, allows you to use the exact same content and markup that you will use for the published entry, and with some moderate magic can resolve all links correctly. Wandering Thoughts is no exception; I long ago created a sort of access-restricted drafts area within CSpace (the (slightly) larger wiki environment that contains the blog).

But this means that there's an important thing you need to do before you type something like 'vi BlogspotWebFail', that being make sure that you're in your drafts directory.

If you skip this step and you're outside the blog's directory hierarchy entirely, there's no particular harm done; you just won't get previews. But if you happen to be inside your blog's directory hierarchy, well, a straightforward file based blog engine will happily go 'oh, a file, this is an entry' and make it publicly visible. Bonus points are awarded if you happen to be drafting the entry within your blog's directory hierarchy but at a different place than the final entry will go.

This is what I managed to do by accident. As a result, I wrote this entry in public, in the wrong place, and of course a version (or perhaps several versions) of the entry propagated into my syndication feed and on to at least one planet site (and a phantom version of it is likely still there in some people's feed readers, partly since syndication feeds don't have any way of retracting entries).

(I might have noticed earlier than I did if I'd tried to preview the entry while I was writing it, but I just wrote it in a big burst. Instead I only noticed at the end when I went to spellcheck it in another window; since the other window was in the drafts directory, I got a 'no such file' error and then a sudden sinking feeling.)

So. Yeah. Sorry about that, for anyone who saw oddities in the syndication feed for a while.

Written on 16 January 2013.
« Why JavaScript (or something like it) is in demand
My favorite way of marking continued lines »

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Wed Jan 16 00:43:10 2013
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.