Skip to content

Commit

Permalink
gitweb: Include a site name in page titles
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alp Toker authored and Junio C Hamano committed Jul 11, 2006
1 parent f6801d6 commit 49da1da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gitweb/gitweb.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 49da1da

Please sign in to comment.