gitweb: configurable home link string
I've always found difficult to figure out git URL for clone from gitweb URL because git:// and http:// are different on many site including kernel.org. I've found this enhancement at http://dev.laptop.org/git when I was on git channel, and thought that it'd be nice if all public gitweb site show it's git URL on its page. This patch allow us to change the home link string. The current default is "projects" as we all see on gitweb now. ie. kernel.org might set this variable to "git://git.kernel.org/pub/scm/" Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Yasushi SHOJI committed
Aug 15, 2006 at 07:50 UTC
2de21fac9842650fceb3db68f15711e38fabc3c8
2 files changed
+6
-1
Makefile
+2
@@ -123,6 +123,7 @@ GIT_PYTHON_DIR = $(prefix)/share/git-core/python
123
124
# default configuration for gitweb
125
GITWEB_CONFIG = gitweb_config.perl
126
+GITWEB_HOME_LINK_STR = projects
127
GITWEB_SITENAME =
128
GITWEB_PROJECTROOT = /pub/git
129
GITWEB_LIST =
@@ -617,6 +618,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
618
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
619
-e 's|++GIT_BINDIR++|$(bindir)|g' \
620
-e 's|++GITWEB_CONFIG++|$(GITWEB_CONFIG)|g' \
621
+ -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
622
-e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
623
-e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
624
-e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
gitweb/gitweb.perl
+4
-1
@@ -36,6 +36,9 @@ our $git_temp = "/tmp/gitweb";
36
# target of the home link on top of all pages
37
our $home_link = $my_uri;
38
39
+# string of the home link on top of all pages
40
+our $home_link_str = "++GITWEB_HOME_LINK_STR++";
41
+
42
# name of your site or organization to appear in page titles
43
# replace this with something more descriptive for clearer bookmarks
44
our $site_name = "++GITWEB_SITENAME++" || $ENV{'SERVER_NAME'} || "Untitled";
@@ -974,7 +977,7 @@ EOF
977
"<a href=\"http://www.kernel.org/pub/software/scm/git/docs/\" title=\"git documentation\">" .
978
"<img src=\"$logo\" width=\"72\" height=\"27\" alt=\"git\" style=\"float:right; border-width:0px;\"/>" .
979
"</a>\n";
977
- print $cgi->a({-href => esc_param($home_link)}, "projects") . " / ";
980
+ print $cgi->a({-href => esc_param($home_link)}, $home_link_str) . " / ";
981
if (defined $project) {
982
print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=summary")}, esc_html($project));
983
if (defined $action) {