]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Cleanup Git logo and Git logo target generation
authorJakub Narebski <redacted>
Fri, 6 Oct 2006 10:31:05 +0000 (12:31 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:10 +0000 (00:07 -0400)
Rename $githelp_url and $githelp_label to $logo_url and $logo_label to
be more obvious what they refer to; while at it add commented out
previous contents (git documentation at kernel.org). Add comment about
logo size.

Use $cgi->a(...) to generate Git logo link; it automatically escapes
attribute values when it is needed.  Escape href attribute using
esc_url instead of (incorrect!) esc_html.

Move styling of git logo <img> element from "style" attribute to CSS
via setting class to "logo".  Perhaps we should set it by id rather
than by class.

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.css
gitweb.perl

index 709ab31209180f9457ecedef0e6877d0d88afb6423e15aa19f46ba5ff15d64e3..5390145634a2bd16a922e56ac59876eeafecc105d9b8f175fea346e50c414c38 100644 (file)
@@ -16,6 +16,11 @@ a:hover, a:visited, a:active {
        color: #880000;
 }
 
+img.logo {
+       float: right;
+       border-width: 0px;
+}
+
 div.page_header {
        height: 25px;
        padding: 8px;
index f651db1b7961c233aae29659423d85fb9d7ced8b8d76c20848cb572c79937b37..1318198a83c93162f3e17ef71ea7f99039579191cc3abc724ac0df790cb0d199 100755 (executable)
@@ -54,13 +54,16 @@ our $stylesheet;
 # default is not to define style sheet, but it can be overwritten later
 undef $stylesheet;
 
-# URI of GIT logo
+# URI of GIT logo (72x27 size)
 our $logo = "++GITWEB_LOGO++";
 # URI of GIT favicon, assumed to be image/png type
 our $favicon = "++GITWEB_FAVICON++";
 
-our $githelp_url = "http://git.or.cz/";
-our $githelp_label = "git homepage";
+# URI and label (title) of GIT logo link
+#our $logo_url = "http://www.kernel.org/pub/software/scm/git/docs/";
+#our $logo_label = "git documentation";
+our $logo_url = "http://git.or.cz/";
+our $logo_label = "git homepage";
 
 # source of projects list
 our $projects_list = "++GITWEB_LIST++";
@@ -1473,11 +1476,9 @@ EOF
        }
 
        print "<div class=\"page_header\">\n" .
-             "<a href=\"" . esc_html($githelp_url) .
-             "\" title=\"" . esc_html($githelp_label) .
-             "\">" .
-             "<img src=\"$logo\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/>" .
-             "</a>\n";
+             $cgi->a({-href => esc_url($logo_url),
+                      -title => $logo_label},
+                     qq(<img src="$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));
This page took 0.232825 seconds and 4 git commands to generate.