The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Micro.blog
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
August 19, 2012

For years my various blogs (including this one) have been powered by $vp$. Each new post is a page inside a VP document, and I would use various scripts or tools I custom wrote to export them into a format suitable for the web. My most recent version, which I had updated for VoodooPad 5, is called "Static" and I'm going to include it in the next release of VoodooPad, version 5.1. A beta of it is available on the latest builds page.

I quipped on Twitter that Static is a lean, mean, Markdown formatting static blog generating machine. It's that and a bit more- but what exactly does that mean?

Markdown
First of all, every post is written in Markdown (specifically MultiMarkdown). VoodooPad 5 includes syntax highlighting for Markdown so this is pretty awesome.

Preview, click and publish
You can use VoodooPad's built in HTML Preview window to see how your post is going to look when it's rendered out. You can even reference images that are embedded in your document and they will show up correctly in the preview.

The interface to Static is a new palette in VoodooPad 5.1. From there you can click a button that says "Publish this page", pick a folder to write everything out to, and there's even a couple of menu items to help you out with creating Markdown links and image tags.

Static
Everything is written out as static HTML files. So if you get linked by Daring Fireball, you're probably going to be OK. This also makes it extremely portable.

Scriptlets
Just because the pages are static, doesn't mean you can't have some dynamic elements at render time. Static renders your scriptlets in the exact same manner as VoodooPad's ePub, HTML, and PDF output does. It's basically like having elements of PHP or JSP, only with JavaScript.

JavaScript events
You can control where archive pages are written, or modify your marked up pages before they are written to disk. Static uses the same type of events that VoodooPad 5 uses for customizing output. Event functions written in JavaScript and called when the export is going to begin, has ended, where single pages are being written out, return a list of extra pages to go along with everything, or modify the configuration of your blog. Tons of things are possible just by editing your document's VPStaticExportScript page.

Macros
You can write your own expanding macros as well. For instance typing in $fm$ will expand to a link pointing to flyingmeat.com (check out the staticExportDidRenderHTMLForItem function in your VPStaticExportScript page for examples).

Static documentation
We've got preliminary documentation on Static available as well. (You should probably read this, but if you don't - the first thing you want to do is call "Setup Document for Static Publishing" menu item under the Static palette).

You own your data
You have all the data for your posts at your fingertips, ready to be uploaded anywhere. If your host goes down or decides they don't want to be in business anymore, then your site is safe.

Static is for power users
Static isn't a novice tool for blog publishing. However if you are JavaScript savvy, Static is a very powerful too.

Multi-user editing
The same magic VoodooPad uses to allow multiple folks to edit the same document over Dropbox works perfectly with Static.

Open source
Static is open source as well. It's part of the VPExtras project on GitHub. Want to see how something is done? Have at it.

At its heart, VoodooPad isn't just a personal wiki- it's a personal CMS. And with Static you can look at your documents from a different angle and have a completely portable web journal which you can edit from VoodooPad for iOS, have multiple people edit over Dropbox, or just get that fuzzy feeling that the data is here, on your computer, which is backed up and you know the data is safe. And maybe someday if you were up to it, you could use the exact same content you've written to publish an ePub or PDF, straight out of VoodooPad.

And getting data in and out of VoodooPad is super easy. Import existing Markdown pages? No problem! Want to export them out as well? Again, no problem.

So if this sort of thing sounds awesome- try out the VoodooPad 5.1 beta and send feedback in! I'd love to hear how it could be even more awesome.