Slipstream - Yet Another New Project!

Introducing Slipstream, my third go-round at a static site generator designed to publish posts from Draft. If you've read my blog, you'll know that I really like Draft, so I won't gush any more about it other than to say that if I'm not writing in Vim then I'm probably writing in Draft.

My first Draft-to-static-blog attempt was also my very first Python package, Draft-in-a-Flask. It took the post, dumped it into the Pelican content directory, and told Pelican to regenerate the blog. It worked fine, but I still found it a bit on the clunky side.

So I tried another tack, which was the simplest possible Flask app that I could create that would generate a blog. It was hackish and ugly (though it worked) but I gave up on that one.

After the lessons that I learned there, I decided to take another run at the problem. Additionally, I decided that I needed to just distribute this via a Docker image. Sure you can run it stand-alone, but the official supported method is via Docker.

If you want to test it out, assuming you already have docker installed you can just copy these commands, paste them into a text editor and then copy/paste from there into your terminal:

docker run -d --name slipstream -p '0.0.0.0:5000:5000' \
  -e SLIPSTREAM_OUTPUT_DIR='/usr/share/nginx/html' \
  -v /usr/share/nginx/html \
  -v /content waynew/slipstream
docker run -d --name webserver \
  --volumes-from slipstream
  -p '0.0.0.0:8080:80' nginx

Now you're up and running! To figure out where you need to point your draft webhook, run this:

curl icanhazip.com

Get your API key:

docker exec slipstream cat .slipstream_api_key

Put them together, fill in all the http niceties, and come up with something that looks like this:

   http://203.0.113.42:5000/vsup5kabBC5Qen2ADH1NMdnGNdgkZ3bXlNUJFZDLdbg=

That's where you want to configure your Draft Webhook. Then you can publish from Draft. If you're running this on your own machine you can just click on http://localhost:8080/ to see your brand new blog. Cool, huh?

There are quite a few settings that you can configure, such as content/output dirs, blog title and URL, so you probably want to do that if you're using it to really deploy your blog. Slipstream is still a work in progress - there are quite a few features that I need to implement before I'd say it's a stable, mature product, so if you're interested in helping out on any of them, head on over to GitHub - I'm always accepting pull requests!

links

social