gitweb: Include a site name in page titles
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 <alp@atoker.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Alp Toker committed
Jul 11, 2006 at 21:10 UTC
49da1dafc075e353c0eb3869de4acf600c594621
1 file changed
+6
-2
gitweb/gitweb.cgi
+6
-2
@@ -46,6 +46,10 @@ if (! -d $git_temp) {
46
# target of the home link on top of all pages
47
our $home_link = $my_uri;
48
49
+# name of your site or organization to appear in page titles
50
+# replace this with something more descriptive for clearer bookmarks
51
+our $site_name = $ENV{'SERVER_NAME'} || "Untitled";
52
+
53
# html text to include at home page
54
our $home_text = "indextext.html";
55
@@ -280,7 +284,7 @@ sub git_header_html {
284
my $status = shift || "200 OK";
285
my $expires = shift;
286
283
- my $title = "git";
287
+ my $title = "$site_name git";
288
if (defined $project) {
289
$title .= " - $project";
290
if (defined $action) {
@@ -1770,7 +1774,7 @@ sub git_opml {
1774
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n".
1775
"<opml version=\"1.0\">\n".
1776
"<head>".
1773
- " <title>Git OPML Export</title>\n".
1777
+ " <title>$site_name Git OPML Export</title>\n".
1778
"</head>\n".
1779
"<body>\n".
1780
"<outline text=\"git RSS feeds\">\n";