Subject: Re: [PATCH] gitweb: Cleanup Git logo and Git logo target generation

From: Jakub Narebski <[email-masked]>
Date: Sat, 7 Oct 2006 11:58:25 +0200

Junio C Hamano wrote:

> Having said that, I am wondering if it is worth doing something
> like this:
> 
> 
> sub img_button {
> 	my $it = $_[0];
> 	my @attr = ();
>         for my $attr (qw(src width height alt class id)) {
> 		next unless exists $it->{$attr};
>                 push @attr, "$attr=\"" . esc_attr($it->{$attr}) . '"';
> 	}
> 	my $img = '<img ' . join(' ', @attr) . ' />';
> 	print $cgi->a({ -href => esc_url($it->{'url'}),
>         		-title => esc_attr($it->{'title'}),
>                       }, $img);
> }
> 
> our %logo = (
> 	# logo image button
> 	src => '++GITWEB_LOGO++',
>         width => 72,
>         height => 27,
> 	alt => 'git logo',
> 
> 	# where that link leads to
>         url => 'http:/git.or.cz/',
> 	title => 'git homepage',
> );

You forgot to add style, i.e. either id => 'logo' or class => 'logo'. 

I'm not sure if it is worth complication. We have similar situation 
(although without image) with $home_link and $home_link_str (as with 
$logo, $logo_url, $logo_label).

I wonder how many people use non-standard logo image, or non standard 
favicon...
-- 
Jakub Narebski
Poland