threads / patch / 4579

patch, 2 partsgitweb: Add filename to page title if set

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

## tl;dr

4 messages between Jun 20, 2006 and Jun 20, 2006. Diffs are folded; open one to read it.

replies: 3people: 1as markdown or json

Jakub Narebski· Jun 20, 2006, 06:17 UTC · lore

[PATCH 0/2] gitweb: Enhance page title

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· Jun 20, 2006, 06:17 UTC · re: Jakub Narebski · lore
---
 gitweb/gitweb.cgi |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
a54751bb328072baed5446bdc4076f1e00002737
Show changes to gitweb/gitweb.cgi +3 −0
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· Jun 20, 2006, 06:17 UTC · re: Jakub Narebski · lore

[PATCH 1/2] gitweb: add '/' to the end of filename in page title for trees

---
 gitweb/gitweb.cgi |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
d17c119d32ae4c5dd50976ea6a255d2bcbe480ed
Show changes to gitweb/gitweb.cgi +3 −0
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

← back to recent threads