Skip to contentSkip to conversation

gitweb: Enhance page title

PATCH In review Jakub Narebski 1 participant 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

cover 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.

#1 lore raw

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

---

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

a54751bb328072baed5446bdc4076f1e00002737

gitweb/gitweb.cgi +3 -0
index 12d5271..1e1a044 100755
@@ -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);
Signature · 1 line
1.3.0
#2 lore raw

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

In reply to Jakub Narebski

---

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

d17c119d32ae4c5dd50976ea6a255d2bcbe480ed

gitweb/gitweb.cgi +3 -0
index 1e1a044..42f3296 100755
@@ -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 .= "/";
+				}
 			}
 		}
 	}
Signature · 1 line
1.3.0
#3 lore raw

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

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

Signature · 3 lines
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git