The Linux distillery
Bringing the world of Linux to you, David cuts through the tech and shows you how it works and how to use it, in terms that apply to any distro. RSS
Technology news and Jobs arrow The Linux distillery arrow Build better blogs with Linux
Build better blogs with Linux E-mail
by David M Williams   
Thursday, 02 October 2008
Chances are you have some sort of web site. Linux has a rich history of text processing which can be used to turbo-boost your blogs. In fact, blogging goes to Linux like a hand to a glove.

The theme for this month is “I didn’t know you could do that in Linux,” and today I’ll show you how Linux can really help your blog take off, both in terms of improving its performance as well as giving you a much greater handle on what’s happening.

The magic behind these items is the native text processing capabilities that Linux has long enjoyed. These capabilities will crunch through log files and web pages extracting data or making changes in a flash.

To start, consider the way images are used on your site. Within the HTML <img> tag you can specify the height and width of the image to be displayed but often these tags are missing. This might be because the content is generated dynamically, or because the HTML has been hand-coded or because a tool did not add those tags when an image was inserted.

Whatever the reason, the HEIGHT and WIDTH attributes are important. A web browser can render a page much more quickly if it knows these values in advance. It can leave an appropriate space for the image while it is still loading it, but with the text and other elements all in the right place.

By contrast, if these attributes are missing the browser must load the image completely before it can display the page in the way it ought to look. Not only is this more aesthetically pleasing but it gives a better experience to your web site visitors. It means they don’t have the page refreshing itself, moving things around, while they’re trying to read it. They can get straight into the content even if not all the pictures are visible.

There’s an extremely handy command – written by none other than Eric S Raymond – called imgsizer. Simply run imgsizer over a HTML file, eg imgsizer index.html – or a series of HTML files, using wildcards like imgsizer *.html – and it will read through the entire page, find every image reference, inspect the image file itself, and then rewrite the page with all the height and width attributes filled in.

This is powerful in its simplicity. Your site will be improved by doing this. Your visitors will appreciate it. And best of all it’s effortless to do especially given the payback.

Ok, it’s one thing to have a web site that’s being read. It’s another to know it’s being read. Let’s see what we can do to help out with that.

CONTINUED







 
< Next story in category   Previous story in the category >
iTWire user statistics Visitors last 30 days
Suscribers
904,266
13,751
#1 independent technology news advertise here
  •   *  
  • Search
  • AdvSeach
  • Login
  • Events
  • FreeStuff
Subscribe to our free e-newsletter