lightbulb logo

How this site works

This site is built from source assets using a python script. Briefly, this is how it all works.

These are the source assets:

The HTML template doesn't contain anything fancy. If you look at the source of this page, you'll see it's pretty simple. This was a deliberate decision to make the site accessible to people using screen readers.

So I put all these files together, run my python script and out pops a web site. I then FTP it to thinkpond.org.

Why am I not using a CMS or at least some kind of web framework? I used to use a CMS (Joomla) and it did the job but for my own projects I have a tendency to make my life difficult and seek out hard ways to solve simple problems. This is the script if you're interested. I don't suggest you use it as a basis for your own site. Do what I should do and use a CMS!

Well I'm not content with this solution. I've thought of a way to make it even more complicated. I'm going to run the build script on the web server itself whenever I upload new content. This also has the advantage that I can then make a commenting system that will regenerate the pages when people leave comments. The common sense way of doing this would of course be to store all the comments in a database and have a server script that queries the database whenever a page is requested. As I said, I want to do everything differently.

I still haven't figured out what to do if two people submit a comment at approximately the same time. Then I'll have two processes trying to generate the same web page at the same time. Hmm...

I'm writing these new scripts using TDD. The current python script has no unit tests at all. It's just a spike (TDD speak for prototype). The new script will have near 100% unit test coverage. And of course the unit tests will be run on the web server whenever I make a change. I might even have a page where you can all see the results of the last test run.

I'm also going to switch from python to ruby. Python is really good but it's mocking framework isn't nearly as good as ruby's. This was my number one priority. I'm test-infected! It also has a better XML processing library out of the box than python. Although python does have amara as a separate library, which is really good too. I think python people would call it 'pythonic'.

So expect to be able to leave comments about my crazy projects any time soon.