"Hello World" and static sites
The process of learning a new programming language often starts by writing the simplest program that outputs Hello world. In the same vein, here is my blogging hello world. I will use this platform as a mean to practice my writing skills and improve my English (I am not a native English speaker). My first post describes the structure of my blog, which is actually (at least as I am writing these lines) a statically generated site.
Why a static site ? Why even host it on my own ?
I have been searching for a blogging platform or engine. There are tons of different alternatives:
- lots of hosted services: wordpress.com, posterous.com, tumblr.com ...
- a bazillion free blogging engines
These are great services, and there are lots of very good blogging engines, but with each solution I felt kind of "trapped". Either the solution was not simple and flexible enough, or worse, it didn't match the way I want to write a post.
I narrowed down what really mattered to me in the choice of a blogging platform:
- technical freedom: being able to tweak and experiment
- not being tied to a particular provider
- secure (at least as secure as something on the web can be)
- create content in a way that is suitable to me
- versioning
These are the main reasons that led me to write a simple static site generator. I could have used Jekyll or Hyde, but writing and maintaining my own little engine allows me to brush up on my web development and python skills.
So what is underneath ?
The core of the site generator is a simple piece of python code that transforms the contents of plain text files using a site skeleton. The skeleton in itself is a small set of jinja2 template files, as well as some assets (i.e. css, images, and javascript). Posts are written using the markdown syntax. Everything is versioned using git.
I needed to go fast in order to release a first version, because ... well .. it is all too easy to indefinitely delay a release when one is caught up in little details. Using python, jinja, markdown proved to be beneficial in this regard.
Hosting
I went the easy route. I use a combination of two Amazon web services: S3 and Cloudfront. The generated pages are hosted in a S3 bucket. The S3 bucket acts as the origin of a Cloudfront distribution. Such a setup might allow the site to survive a spike of traffic, If I ever get the chance to write something that a lot of people find interesting.
Next
Mundane evolutions like fixing CSS display quirks, "polishing" the design, automating certain operations as well as adding some minor functionalities (for instance, returning normal 404s instead of cloudfront errors). Moreover I intend to use the generator in various other ways that I will describe in future posts ;)