{"thread":{"id":"4852","subject":"[PATCH] gitweb: Include a site name in page titles","startedAt":"2006-07-11T20:10:26Z","lastAt":"2006-07-11T20:10:26Z","messageCount":1,"participants":["Alp Toker"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"23660","messageId":"11526486261142-git-send-email-alp@atoker.com","threadId":"4852","inReplyTo":null,"subject":"[PATCH] gitweb: Include a site name in page titles","fromName":"Alp Toker","fromEmail":"alp@atoker.com","sentAt":"2006-07-11T20:10:26Z","receivedAt":"2006-07-11T20:10:26Z","isPatch":true,"sender":{"key":"alp@atoker.com","avatar":"https://gravatar.com/avatar/5367b73f1bb2598314e084847e4f45c303514c7fd192cfa9aa3c3437511567cd?d=mp&s=160"},"body":"Tip Of The Day:\n    <title>: the most important element of a quality Web page.\n\nThis helps users tell one 'git' bookmark apart from the other in their\nbrowser and improves the indexing of gitweb sites in Web search engines.\n\nDefaults to the HTTP SERVER_NAME.\n\nSigned-off-by: Alp Toker <alp@atoker.com>\n---\n gitweb/gitweb.cgi |    8 ++++++--\n 1 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi\nindex 2e87de4..be0a01d 100755\n--- a/gitweb/gitweb.cgi\n+++ b/gitweb/gitweb.cgi\n@@ -46,6 +46,10 @@ if (! -d $git_temp) {\n # target of the home link on top of all pages\n our $home_link = $my_uri;\n \n+# name of your site or organization to appear in page titles\n+# replace this with something more descriptive for clearer bookmarks\n+our $site_name = $ENV{'SERVER_NAME'} || \"Untitled\";\n+\n # html text to include at home page\n our $home_text = \"indextext.html\";\n \n@@ -280,7 +284,7 @@ sub git_header_html {\n \tmy $status = shift || \"200 OK\";\n \tmy $expires = shift;\n \n-\tmy $title = \"git\";\n+\tmy $title = \"$site_name git\";\n \tif (defined $project) {\n \t\t$title .= \" - $project\";\n \t\tif (defined $action) {\n@@ -1760,7 +1764,7 @@ sub git_opml {\n \tprint \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\".\n \t      \"<opml version=\\\"1.0\\\">\\n\".\n \t      \"<head>\".\n-\t      \"  <title>Git OPML Export</title>\\n\".\n+\t      \"  <title>$site_name Git OPML Export</title>\\n\".\n \t      \"</head>\\n\".\n \t      \"<body>\\n\".\n \t      \"<outline text=\\\"git RSS feeds\\\">\\n\";\n-- \n1.4.1.g97c7-dirty\n"}]}