TRANSCODE Explorations into the Code Transcendental.

Crossing the Assets Divide

Crossing the Assets Divide

Working on Smeagol, a read-only Gollum server and static site generator, I’ve come across an unusual issue. One of the features Smeagol provides is the ability to view page history. By providing a git commit-id or a tag name in the URL, an older version of any page can be viewed. Now, if a page includes a local asset, an image being the typical example, that file clearly must come from the same commit as well. And here is were a problem arises. While content assets must be versioned, design assets must not. We may want to look at the content of an old page for historical reference; we don’t want look at it as if on the website as it was designed way back when. Indeed, the functionality of the site back then might have had bugs in it, it might have a had a very stark layout, it might have any number of issues which have since been corrected. Certainly the site should not serve up old stylesheets, javascripts, background images and the like. Only old content must be served.

As it has become the fashion in web-design, stylesheets, javascripts, images, and so on are placed in a single assets/ directory. (Even without an assets/ directory, asset files are generally placed in central bins such as images/.) Because of this there is no straight forward way to determine which files are for content and which are for site design. So, as it happens, there turns out to be a need to divide the assets in two. One directory for design and another for content.

I now find myself with the unenviable decision of what to name these two directories. Do I keep assets/ for design or content? And what do I name the other directory? Or should I use two new names altogether?

[UPDATE] At present I have opted to keep assets/ for design-related files and move content assets to media/. Technically, it turns out that it doesn’t matter where the content files go as long as it is not in assets/.