From: Jonathan Nieder Date: Tue, 04 Jan 2011 05:05:55 GMT Subject: [PATCH 2/2] gitweb: make logo optional Message-ID: <20110104050555.GC8280@burratino> In-Reply-To: <20110104050206.GA8280@burratino> Date: Fri, 3 Sep 2010 19:45:09 -0500 Some sites may not want to have a logo at all. In particular, git instaweb can benefit from this. While at it, use $cgi->img to simplify this code. (CGI.pm learned most HTML4 tags by version 2.79, so this should be portable to perl 5.8, though I haven't tested.) Signed-off-by: Jonathan Nieder --- Eric liked an earlier version of this patch that did not use $cgi->img. gitweb/gitweb.perl | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index c65af1a..064697c 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -3601,10 +3601,15 @@ EOF insert_file($site_header); } - print "
\n" . - $cgi->a({-href => esc_url($logo_url), - -title => $logo_label}, - qq()); + print "
\n"; + if (defined $logo) { + print $cgi->a({-href => esc_url($logo_url), + -title => $logo_label}, + $cgi->img({-src => esc_url($logo), + -width => 72, -height => 27, + -alt => "git", + -class => "logo"})); + } print $cgi->a({-href => esc_url($home_link)}, $home_link_str) . " / "; if (defined $project) { print $cgi->a({-href => href(action=>"summary")}, esc_html($project)); -- 1.7.4.rc0