From: Jakub Narebski Date: Sat, 07 Oct 2006 09:58:25 GMT Subject: Re: [PATCH] gitweb: Cleanup Git logo and Git logo target generation Message-ID: <200610071158.26211.jnareb@gmail.com> In-Reply-To: <7viriwwmid.fsf@assigned-by-dhcp.cox.net> 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 = ''; > 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