About Books Credits Photos Software Rumblings Travelling Home
Evolving the site - Take 5

It’s been quite a while since I posted anything.

It was a combination of factors that prevented me for a few months, but lately it was just my dissatisfaction with the code that generates this blog.

I wanted more flexibility, an easier way to configure structure and an easier way to write content.

RedCloth takes care of the content generation requirement.

Integrating it in the code was not that difficult, but it’s use opened up a few possibilities (like an easier syntax for internal linking). Then I started thinking about a more flexible way to define sections for content, which led to the possibility of adding separate RSS feeds for each section.

With each added requirement the old code showed more and more flaws in it’s architecture, since it made it very difficult to add additional features. Mostly the problem lied in the use of XML for configuration and content but also in the fact that that first iteration was a bottom-up design, meaning that I started with the page layout and then built the code so that one template could be used. As soon as changes where made in the layout, the whole thing just became unwieldy.

So, throw the code in the bin and start from scratch. Configuration is now a Ruby file:


    site.name="Αμπελοφιλοσοφίες" 

    site.owner="riva" 

    site.url="http://www.braveworld.net/riva" 

    site.rss=true

    site.source="content" 

    site.target="#{site.name}" 

    site.template="ampelofilosofies.rhtml" 

    site.section={:name=>"Rumblings",:rss=>true}

    site.section={:name=>"Software",:rss=>true}

    site.section={:name=>"Books",:rss=>true}

    site.section={:name=>"Travelling"}

    site.section={:name=>"About"}

    site.section={:name=>"Credits"}

    site.section={:name=>"index"}

    site.resource={:type=>:data,:content=>"ampelofilosofies.css"}

    site.resource={:type=>:data,:content=>"data/diodia_kastanias.mpg"}

    site.resource={:type=>:data,:content=>"images"}

The content generating code is separated and can be substituted (so I could use i.e. Markdown instead of Textile) and there is even a concept about a Site with Sections and Articles which is configured and then exported using Pages, Links and Resources.

So the current object hierarchy allows for nested sections, separate RSS and better dating of articles (previously everything was posted at 00:00 of any date). Some things that have not been implemented yet, but are now very easy are:

By the way, you might have noticed that the manu on each page is different. This is actually intended even though it goes against several

usability guidelines :).

ZenTest and Hoe are put to the test as well, although in the case of Hoe more as an exercise for future reference since I don’t plan to release the code at the moment.

Finally, the script that generates the site is now just a single line:

bq.generate_site(“config.rb”,”ampelofilosofies”)

Well, now it seems I have no more excuses for not posting anything.