]> source.dussan.org Git - gitblit.git/commitdiff
Documentation. Site changes.
authorJames Moger <james.moger@gitblit.com>
Wed, 6 Jul 2011 00:31:06 +0000 (20:31 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 6 Jul 2011 00:31:06 +0000 (20:31 -0400)
build.xml
docs/site_header.html
src/com/gitblit/build/BuildSite.java

index 67c3910b1b1605b503a5e301c749449f6641720c..406fbd99bb3aefaa13e3c369a8a8d0ce6ba376ff 100644 (file)
--- a/build.xml
+++ b/build.xml
 \r
                        <arg value="--pageHeader" />\r
                        <arg value="${basedir}/docs/site_header.html" />\r
-\r
+                       \r
                        <arg value="--pageFooter" />\r
                        <arg value="${basedir}/docs/site_footer.html" />\r
 \r
+                       <arg value="--analyticsSnippet" />\r
+                       <arg value="${basedir}/docs/site_analytics.html" />\r
+                               \r
+                       <arg value="--adSnippet" />\r
+                       <arg value="${basedir}/docs/site_ads.html" />\r
+\r
                        <arg value="--alias" />\r
                        <arg value="index=overview" />\r
 \r
index 6263504516b5b5e2831ed89a5685587c2446a005..51552209a89932ad0e121e0da26696aac8a5a080 100644 (file)
@@ -26,7 +26,8 @@
                </style>\r
                \r
                <script type="text/javascript" src="prettify/prettify.js"></script>\r
-               <link href="prettify/prettify.css" type="text/css" rel="stylesheet" />          \r
+               <link href="prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+               <!-- ANALYTICS -->\r
        </head>\r
        <body style="width:900px"  onload="prettyPrint()">\r
                <a href="http://github.com/gitblit"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://d3nwyuy0nl342s.cloudfront.net/img/30f550e0d38ceb6ef5b81500c64d970b7fb0f028/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub"></a>\r
index 81cc8f29c63d154130b0d1313b04a7402b6dc8bd..a2f6431642cbd2f34572a4a734725e32190e0ccd 100644 (file)
@@ -99,9 +99,24 @@ public class BuildSite {
                sb.trimToSize();\r
 \r
                String htmlHeader = FileUtils.readContent(new File(params.pageHeader), "\n");\r
+               \r
+               String htmlAdSnippet = null;\r
+               if (!StringUtils.isEmpty(params.adSnippet)) {\r
+                       File snippet = new File(params.adSnippet);\r
+                       if (snippet.exists()) {\r
+                               htmlAdSnippet = FileUtils.readContent(snippet, "\n");\r
+                       }\r
+               }\r
                String htmlFooter = FileUtils.readContent(new File(params.pageFooter), "\n");\r
-               final String links = sb.toString();\r
-               final String header = MessageFormat.format(htmlHeader, Constants.FULL_NAME, links);\r
+               String links = sb.toString();\r
+               String header = MessageFormat.format(htmlHeader, Constants.FULL_NAME, links);\r
+               if (!StringUtils.isEmpty(params.analyticsSnippet)) {\r
+                       File snippet = new File(params.analyticsSnippet);\r
+                       if (snippet.exists()) {\r
+                               String htmlSnippet = FileUtils.readContent(snippet, "\n");\r
+                               header = header.replace("<!-- ANALYTICS -->", htmlSnippet);\r
+                       }\r
+               }               \r
                final String date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());\r
                final String footer = MessageFormat.format(htmlFooter, "generated " + date);\r
                for (File file : markdownFiles) {\r
@@ -128,6 +143,9 @@ public class BuildSite {
                                        OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(\r
                                                        new File(destinationFolder, fileName)), Charset.forName("UTF-8"));\r
                                        writer.write(header);\r
+                                       if (!StringUtils.isEmpty(htmlAdSnippet)) {\r
+                                               writer.write(htmlAdSnippet);\r
+                                       }\r
                                        writer.write(content);\r
                                        writer.write(footer);\r
                                        reader.close();\r
@@ -179,6 +197,12 @@ public class BuildSite {
                @Parameter(names = { "--pageFooter" }, description = "Page Footer HTML Snippet", required = true)\r
                public String pageFooter;\r
 \r
+               @Parameter(names = { "--adSnippet" }, description = "Ad HTML Snippet", required = false)\r
+               public String adSnippet;\r
+\r
+               @Parameter(names = { "--analyticsSnippet" }, description = "Analytics HTML Snippet", required = false)\r
+               public String analyticsSnippet;\r
+\r
                @Parameter(names = { "--skip" }, description = "Filename to skip", required = false)\r
                public List<String> skips = new ArrayList<String>();\r
 \r