# [PATCH 1/2] gitweb: Add filename to page title if set

4 messages from 2006-06-20 to 2006-06-20. Participants: Jakub Narebski.
Thread: https://gitlist.dev/t/4579

## Jakub Narebski, 2006-06-20 06:17

Subject: [PATCH 1/2] gitweb: Add filename to page title if set
Message-ID: <11507842063504-git-send-email-jnareb@gmail.com>
URL: https://gitlist.dev/e/11507842063504-git-send-email-jnareb%40gmail.com
In-Reply-To: <11507842053885-git-send-email-jnareb@gmail.com>

```
---

 gitweb/gitweb.cgi |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

a54751bb328072baed5446bdc4076f1e00002737
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 12d5271..1e1a044 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -260,7 +260,10 @@ sub git_header_html {
 	if (defined $project) {
 		$title .= " - $project";
 		if (defined $action) {
+			if (defined $file_name) {
+				$title .= " - $file_name";
+			}
 		}
 	}
 	print $cgi->header(-type=>'text/html',  -charset => 'utf-8', -status=> $status, -expires => $expires);
-- 
1.3.0

```

## Jakub Narebski, 2006-06-20 06:17

Subject: [PATCH 0/2] gitweb: Enhance page title
Message-ID: <11507842053885-git-send-email-jnareb@gmail.com>
URL: https://gitlist.dev/e/11507842053885-git-send-email-jnareb%40gmail.com

```

This series of patches adds filename (with '/' at the end added for 
trees, i.e. directories) to the page title, for easier bookmarking and 
viewing browser history.

On top of 'next', but should apply cleanly for 'master' too.

```

## Jakub Narebski, 2006-06-20 06:17

Subject: [PATCH 1/2] gitweb: add '/' to the end of filename in page title for trees
Message-ID: <1150784206793-git-send-email-jnareb@gmail.com>
URL: https://gitlist.dev/e/1150784206793-git-send-email-jnareb%40gmail.com
In-Reply-To: <11507842053885-git-send-email-jnareb@gmail.com>

```
---

 gitweb/gitweb.cgi |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

d17c119d32ae4c5dd50976ea6a255d2bcbe480ed
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 1e1a044..42f3296 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -263,6 +263,9 @@ sub git_header_html {
 			$title .= "/$action";
 			if (defined $file_name) {
 				$title .= " - $file_name";
+				if ($action eq "tree" && $file_name !~ m|/$|) {
+					$title .= "/";
+				}
 			}
 		}
 	}
-- 
1.3.0

```

## Jakub Narebski, 2006-06-20 06:22

Subject: Re: [PATCH 1/2] gitweb: add '/' to the end of filename in page title for trees
Message-ID: <e7846d$uqn$1@sea.gmane.org>
URL: https://gitlist.dev/e/e7846d%24uqn%241%40sea.gmane.org
In-Reply-To: <1150784206793-git-send-email-jnareb@gmail.com>

```
This should of course be [PATCH 2/2]. I'm sorry for mistake.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```
