From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Chandler Subject: [Patch] gitweb added site css, header and footer Date: Sat, 12 Nov 2005 17:50:30 +0000 Message-ID: <200511121750.30477.alan@chandlerfamily.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sat Nov 12 18:51:57 2005 Return-path: Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EazWI-0001GC-Kg for gcvg-git@gmane.org; Sat, 12 Nov 2005 18:50:31 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932426AbVKLRu2 (ORCPT ); Sat, 12 Nov 2005 12:50:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932433AbVKLRu1 (ORCPT ); Sat, 12 Nov 2005 12:50:27 -0500 Received: from 82-44-22-127.cable.ubr06.croy.blueyonder.co.uk ([82.44.22.127]:1682 "EHLO home.chandlerfamily.org.uk") by vger.kernel.org with ESMTP id S932426AbVKLRu1 (ORCPT ); Sat, 12 Nov 2005 12:50:27 -0500 Received: from kanger.home ([192.168.0.21]) by home.chandlerfamily.org.uk with esmtp (Exim 4.50) id 1EazWE-0003ZJ-0n; Sat, 12 Nov 2005 17:50:26 +0000 To: kay.sievers@vrfy.org User-Agent: KMail/1.8.2 Content-Disposition: inline Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: I wanted to include gitweb on my site - but with the ability to keep my own site header and footer. I have therefore made a few changes to enable this to happen. I also had a problem in that I had installed gitweb.cgi in /usr/lib/cgi-bin, and it was attempting to read indextext.html from this directory rather than the projectroot. I have therefore changed it to pick up this file from projectroot, and also two other files header.html and footer.html which contain the html for the header and footer of each page. Lastly, I have made a paramter at the top of the file for the the url to my site wide css file. Signed-off-by: Alan Chandler I am not sure what the netiquette is with regards these changes. I have published them as the master branch at http://www.chandlerfamily.org.uk/git/gitweb.git but I have also attached a patch below (and someone can tell me if kmail does the "right thing") What should one do about the changes to the variables at the top of the file, you will see I have changed $projectroot and $gitbin --------- diff --git a/gitweb.cgi b/gitweb.cgi index b8f1537..d16def4 100755 --- a/gitweb.cgi +++ b/gitweb.cgi @@ -22,10 +22,10 @@ my $rss_link = ""; # absolute fs-path which will be prepended to the project path #my $projectroot = "/pub/scm"; -my $projectroot = "/home/kay/public_html/pub/scm"; +my $projectroot = "/var/lib/git"; # location of the git-core binaries -my $gitbin = "/usr/bin"; +my $gitbin = "/usr/local/bin"; # location for temporary files needed for diffs my $git_temp = "/tmp/gitweb"; @@ -33,12 +33,25 @@ my $git_temp = "/tmp/gitweb"; # target of the home link on top of all pages my $home_link = $my_uri; +#css url for overall site + +my $site_css_url = "/style/site.css"; + +#page header and footer for all pages on this site + +my $site_header= $projectroot."/header.html"; +my $site_footer= $projectroot."/footer.html"; + # html text to include at home page -my $home_text = "indextext.html"; +my $home_text = $projectroot."/indextext.html"; # source of projects list -#my $projects_list = $projectroot; -my $projects_list = "index/index.aux"; +my $projects_list = $projectroot; +#my $projects_list = "index/index.aux"; + + + + # input validation and dispatch my $action = $cgi->param('a'); @@ -217,6 +230,12 @@ sub git_header_html { $title .= "/$action"; } } + + my $site_css = ""; + if (defined $site_css_url) { + $site_css=""; + } + print $cgi->header(-type=>'text/html', -charset => 'utf-8', -status=> $status, -expires => $expires); print < @@ -228,6 +247,7 @@ sub git_header_html { $title $rss_link +$site_css