O'Reilly logo

HTML & CSS: The Good Parts by Ben Henick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Publishing Images

Publishing images might seem like a straightforward task, but that’s not always the case. Destination folders, filenaming conventions, and Content Management System (CMS) behavior are relevant to image publication, to degrees that vary on a per-project basis.

Keeping Images Organized

If a site has reasonably high production values, it will likely incorporate dozens or hundreds of images. Larger sites, especially those operated by social networking services, often store hundreds of thousands or even millions of individual image files.

So if you’re the one who needs to keep them all organized, what do you do?

In some ways, the organization of a site’s image assets is a mirror of the organization of the site itself; the only major cognitive challenge of image management arises when you have so many images to organize that you need to spread them across multiple directories. For small sites, my approach is to upload files to an /images directory and name them with series of tokens, for example:

/images/bg_sidebar_contact.jpg

When generalized, that comes across as:

type_pagescope_sitescope.ext

There are other tokens you can add: subject descriptors, artist surnames, and production dates all offer legible clues about an image’s content, at least to a maintainer who is familiar with the site.

Filename tokens can follow whatever order you feel is most appropriate. I choose to put a type token first, because in my experience it makes file listings easier to scan.

On larger sites, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required