{"thread":{"id":"28697","subject":"[PATCH] gitweb: provide a way to customize html headers","startedAt":"2011-10-16T20:56:41Z","lastAt":"2011-10-16T21:26:18Z","messageCount":2,"participants":["Lénaïc Huard","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"177802","messageId":"201110162256.41431.lenaic@lhuard.fr.eu.org","threadId":"28697","inReplyTo":null,"subject":"[PATCH] gitweb: provide a way to customize html headers","fromName":"Lénaïc Huard","fromEmail":"lenaic@lhuard.fr.eu.org","sentAt":"2011-10-16T20:56:41Z","receivedAt":"2011-10-16T20:56:41Z","isPatch":true,"sender":{"key":"lenaic@lhuard.fr.eu.org","avatar":null},"body":"This allows web sites to add some specific html headers to the pages\ngenerated by gitweb.\n\nThe new variable $site_htmlheader can be set to a filename the content\nof which will be inserted at the end of the <head> section of each\npage generated by gitweb.\n\nSigned-off-by: Lénaïc Huard <lenaic@lhuard.fr.eu.org>\n---\n gitweb/INSTALL     |    3 +++\n gitweb/Makefile    |    2 ++\n gitweb/gitweb.perl |    7 +++++++\n t/gitweb-lib.sh    |    1 +\n 4 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/gitweb/INSTALL b/gitweb/INSTALL\nindex f5efe74..e23eafa 100644\n--- a/gitweb/INSTALL\n+++ b/gitweb/INSTALL\n@@ -130,6 +130,9 @@ You can specify the following configuration variables when building GIT:\n    Points to an .html file which is included on the gitweb project\n    overview page ('projects_list' view), if it exists.  Relative to\n    gitweb.cgi script.  [Default: indextext.html]\n+ * GITWEB_SITE_HTMLHEADER\n+   Filename of html code to include in the <head> section of each page.\n+   Relative to gitweb.cgi script.  [No default]\n  * GITWEB_SITE_HEADER\n    Filename of html text to include at top of each page.  Relative to\n    gitweb.cgi script.  [No default]\ndiff --git a/gitweb/Makefile b/gitweb/Makefile\nindex 1c85b5f..ecfb311 100644\n--- a/gitweb/Makefile\n+++ b/gitweb/Makefile\n@@ -34,6 +34,7 @@ GITWEB_CSS = static/gitweb.css\n GITWEB_LOGO = static/git-logo.png\n GITWEB_FAVICON = static/git-favicon.png\n GITWEB_JS = static/gitweb.js\n+GITWEB_SITE_HTMLHEADER =\n GITWEB_SITE_HEADER =\n GITWEB_SITE_FOOTER =\n HIGHLIGHT_BIN = highlight\n@@ -144,6 +145,7 @@ GITWEB_REPLACE = \\\n        -e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \\\n        -e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \\\n        -e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \\\n+       -e 's|++GITWEB_SITE_HTMLHEADER++|$(GITWEB_SITE_HTMLHEADER)|g' \\\n        -e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \\\n        -e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \\\n        -e 's|++HIGHLIGHT_BIN++|$(HIGHLIGHT_BIN)|g'\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 85d64b2..63b0115 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -85,6 +85,8 @@ our $home_link_str = \"++GITWEB_HOME_LINK_STR++\";\n our $site_name = \"++GITWEB_SITENAME++\"\n                  || ($ENV{'SERVER_NAME'} || \"Untitled\") . \" Git\";\n \n+# filename of html code to include in the <head> section of each page\n+our $site_htmlheader = \"++GITWEB_SITE_HTMLHEADER++\";\n # filename of html text to include at top of each page\n our $site_header = \"++GITWEB_SITE_HEADER++\";\n # html text to include at home page\n@@ -3879,6 +3881,11 @@ EOF\n                print \"<base href=\\\"\".esc_url($base_url).\"\\\" />\\n\";\n        }\n        print_header_links($status);\n+\n+       if (defined $site_htmlheader && -f $site_htmlheader) {\n+               insert_file($site_htmlheader);\n+       }\n+\n        print \"</head>\\n\" .\n              \"<body>\\n\";\n \ndiff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh\nindex 292753f..cfe5d74 100644\n--- a/t/gitweb-lib.sh\n+++ b/t/gitweb-lib.sh\n@@ -16,6 +16,7 @@ our \\$projectroot = \"$safe_pwd\";\n our \\$project_maxdepth = 8;\n our \\$home_link_str = 'projects';\n our \\$site_name = '[localhost]';\n+our \\$site_htmlheader = '';\n our \\$site_header = '';\n our \\$site_footer = '';\n our \\$home_text = 'indextext.html';\n-- \n1.7.7\n"},{"id":"177803","messageId":"m3d3dw7ho4.fsf@localhost.localdomain","threadId":"28697","inReplyTo":"201110162256.41431.lenaic@lhuard.fr.eu.org","subject":"Re: [PATCH] gitweb: provide a way to customize html headers","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-10-16T21:26:18Z","receivedAt":"2011-10-16T21:26:18Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"䳾＀懾＀⁈畡牤‼汥湡楣䁬桵慲搮晲⹥甮潲朾⁷物瑥猺ਊ㸠周楳⁡汬潷猠睥戠獩瑥猠瑯⁡摤⁳潭攠獰散楦楣⁨瑭氠桥慤敲猠瑯⁴桥⁰慧敳ਾ⁧敮敲慴敤⁢礠杩瑷敢⸊੗桡琠摯⁹潵⁮敥搠瑨楳⁦潲㼊 㸠周攠湥眠癡物慢汥․獩瑥彨瑭汨敡摥爠捡渠扥⁳整⁴漠愠晩汥湡浥⁴桥⁣潮瑥湴ਾ⁯映睨楣栠睩汬⁢攠楮獥牴敤⁡琠瑨攠敮搠潦⁴桥‼桥慤㸠獥捴楯渠潦⁥慣栊㸠灡来⁧敮敲慴敤⁢礠杩瑷敢⸊ੈ浭洮⸮⁉⁷潮摥爠楦⁡⁦楬攠睩瑨⁨瑭氠桥慤敲⁦牡杭敮琠⡷桩捨⁩猠煵楴攊獰散楦楣⁳畢獥琠潦⁈呍䰩⁩猠愠扥獴⁳潬畴楯渮ਊ㸠ਾ⁓楧湥搭潦昭批㨠䳾＀懾＀⁈畡牤‼汥湡楣䁬桵慲搮晲⹥甮潲朾ਾ‭ⴭਾ†杩瑷敢⽉乓呁䱌††⁼††㌠⬫⬊੎戮⁴桥牥⁩猠灡瑣栠楮⁦汩杨琠慤摩湧⁧楴睥戮捯湦⠵⤠慮搠杩瑷敢⠱⤊浡湰慧敳⸮⸊ਭⴠ੊慫畢⁎慲﻿ę扳歩�"}]}