]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Include a site name in page titles
authorAlp Toker <redacted>
Tue, 11 Jul 2006 20:10:26 +0000 (21:10 +0100)
committerLady <redacted>
Sat, 4 Apr 2026 18:43:37 +0000 (14:43 -0400)
This helps users tell one 'git' bookmark apart from the other in their
browser and improves the indexing of gitweb sites in Web search engines.
The title defaults to the SERVER_NAME environment variable, often given
by the webserver.

Signed-off-by: Alp Toker <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.cgi

index f9abf864203db634310f7d91f59121c2c37ee1e8febc22c871c4ab06b5d49b38..2f313df912644b2c33639ae3539a3295cd3d2859d92d0dba31ae4b40b1eb6da3 100755 (executable)
@@ -46,6 +46,10 @@ if (! -d $git_temp) {
 # target of the home link on top of all pages
 our $home_link = $my_uri;
 
+# name of your site or organization to appear in page titles
+# replace this with something more descriptive for clearer bookmarks
+our $site_name = $ENV{'SERVER_NAME'} || "Untitled";
+
 # html text to include at home page
 our $home_text = "indextext.html";
 
@@ -280,7 +284,7 @@ sub git_header_html {
        my $status = shift || "200 OK";
        my $expires = shift;
 
-       my $title = "git";
+       my $title = "$site_name git";
        if (defined $project) {
                $title .= " - $project";
                if (defined $action) {
@@ -1770,7 +1774,7 @@ sub git_opml {
        print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".
              "<opml version=\"1.0\">\n".
              "<head>".
-             "  <title>Git OPML Export</title>\n".
+             "  <title>$site_name Git OPML Export</title>\n".
              "</head>\n".
              "<body>\n".
              "<outline text=\"git RSS feeds\">\n";
This page took 0.263015 seconds and 4 git commands to generate.