I like blogging from time to time, but I wish I could do things the way I like. One issue I have with having my blog here on wordpress is that I don’t have a local copy of it on my machine & it isn’t versioned in a repository (which has basically become my obsession). I wanted to find a solution that gave me these two things, and the flexibility to do anything else (such as in what markup to write the posts).
I have, therefore, found my own solution:
- Write the blog posts as Markdown files
- Generate the HTML from those files (using Steve Losh‘s d tool)
- Serve those HTML pages with python’s embed SimpleHTTPServer, on Heroku.
The key was in setting up the requirements.txt file with the pip dependencies, and then configuring the Procfile to run “d” and then serve the HTML files with SimpleHTTPServer, on the port provided by Heroku.
Although at the moment it only has temporary content, just to see if I could get it working, you can find the final results here: http://dwijnand.herokuapp.com and the source here: https://github.com/dwijnand/dwijnand.herokuapp.com
I’m pretty sure there might be a bit of a nicer way to do the python part (combining d and SimpleHTTPServer), but this is what I (very happily) got working.
Please let me know if you have any comments 😀