diff mercurial/hgweb/hgwebdir_mod.py @ 4084:51e52db6b40d

hgweb: allow static files to be served directly by the HTTP server
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 15 Feb 2007 08:51:32 -0200
parents e6d26e71f049
children ca639faa38a2
line wrap: on
line diff
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -88,6 +88,10 @@ class hgwebdir(object):
         if not url.endswith('/'):
             url += '/'
 
+        staticurl = config('web', 'staticurl') or url + 'static/'
+        if not staticurl.endswith('/'):
+            staticurl += '/'
+
         style = self.style
         if style is None:
             style = config('web', 'style', '')
@@ -98,7 +102,8 @@ class hgwebdir(object):
                                    defaults={"header": header,
                                              "footer": footer,
                                              "motd": motd,
-                                             "url": url})
+                                             "url": url,
+                                             "staticurl": staticurl})
 
         def archivelist(ui, nodeid, url):
             allowed = ui.configlist("web", "allow_archive", untrusted=True)