git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] git-instaweb: Static files are under "static/" in gitweb_conf

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 29, 2010, 16:48 UTC
Message-ID
<201012291748.14484.jnareb@gmail.com>
In-Reply-To
<201012291743.41213.jnareb@gmail.com>

The variables used to compose links for gitweb static files, i.e. @stylesheets / $stylesheet, $logo, etc. are configurable via GITWEB_CSS, GITWEB_LOGO, etc. gitweb build configuration variables. The installation directory of those static files is currently always set to $(gitwebdir)/static. Thus git-instaweb could rely on the place where those files are installed, but not on $logo, $favicon etc. variables.

Set @stylesheets, $logo, $favicon and $javascript to their default values in gitweb config file for git-instaweb (in gitweb_conf function), so that web servers invoked by git-instaweb (for example Plack::Middleware::Static component for 'plackup' web server) can correctly serve links to those static files.

We assume here that git-instaweb uses modern gitweb with names of gitweb config variables as mentioned above.

Note that we had to take care that possible optional minimizations of stylesheet and of javascript is correctly taken into account.

This is continuation of fixup for issue noticed by Tadeusz Sośnierz with --httpd=plackup and gitweb stylesheet (CSS).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
The subject (commit description) is not the best, but that is what I
was able to come up with.

This doesn't matter for default configuration and setup, but it allows me to use my custom gitweb build configuration without any changes in result.

 git-instaweb.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/git-instaweb.sh b/git-instaweb.sh
index bb57d81..da569f2 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -581,6 +581,11 @@ our \$projectroot = "$(dirname "$fqgitdir")";
 our \$git_temp = "$fqgitdir/gitweb/tmp";
 our \$projects_list = \$projectroot;
 
+our @stylesheets = ("static/".basename(\$stylesheets[0]));
+our \$logo = "static/git-logo.png";
+our \$favicon = "static/git-favicon.png";
+our \$javascript = "static/".basename(\$javascript);
+
 \$feature{'remote_heads'}{'default'} = [1];
 EOF
 }
-- 
1.7.3
Previous: Jakub NarebskiNext: Jakub Narebski
Message 6 of 9 in “git-instaweb: Three fixes and one improvement”
  1. 0/4 git-instaweb: Three fixes and one improvementJakub Narebski, Dec 29, 2010
  2. 1/4 git-instaweb: Fix issue with static files for 'plackup' serverJakub Narebski, Dec 29, 2010
  3. Junio C HamanoDec 29, 2010
  4. Junio C HamanoDec 29, 2010
  5. Jakub NarebskiDec 30, 2010
  6. 2/4 git-instaweb: Static files are under "static/" in gitweb_confJakub Narebski, Dec 29, 2010
  7. 3/4 git-instaweb: Add checks that web server can be started and is startedJakub Narebski, Dec 29, 2010
  8. 4/4 git-instaweb: Use "git-instaweb" as sitename (for page titles)Jakub Narebski, Dec 29, 2010
  9. Eric WongDec 30, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.