James Moger
2011-07-05 e7a153663f6432eb2bd0bb1cce06a9fa1c2be364
Documentation.  Site changes.
3 files modified
39 ■■■■ changed files
build.xml 8 ●●●● patch | view | raw | blame | history
docs/site_header.html 3 ●●●● patch | view | raw | blame | history
src/com/gitblit/build/BuildSite.java 28 ●●●●● patch | view | raw | blame | history
build.xml
@@ -423,10 +423,16 @@
            <arg value="--pageHeader" />
            <arg value="${basedir}/docs/site_header.html" />
            <arg value="--pageFooter" />
            <arg value="${basedir}/docs/site_footer.html" />
            <arg value="--analyticsSnippet" />
            <arg value="${basedir}/docs/site_analytics.html" />
            <arg value="--adSnippet" />
            <arg value="${basedir}/docs/site_ads.html" />
            <arg value="--alias" />
            <arg value="index=overview" />
docs/site_header.html
@@ -26,7 +26,8 @@
        </style>
        
        <script type="text/javascript" src="prettify/prettify.js"></script>
        <link href="prettify/prettify.css" type="text/css" rel="stylesheet" />
        <link href="prettify/prettify.css" type="text/css" rel="stylesheet" />
        <!-- ANALYTICS -->
    </head>
    <body style="width:900px"  onload="prettyPrint()">
        <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>
src/com/gitblit/build/BuildSite.java
@@ -99,9 +99,24 @@
        sb.trimToSize();
        String htmlHeader = FileUtils.readContent(new File(params.pageHeader), "\n");
        String htmlAdSnippet = null;
        if (!StringUtils.isEmpty(params.adSnippet)) {
            File snippet = new File(params.adSnippet);
            if (snippet.exists()) {
                htmlAdSnippet = FileUtils.readContent(snippet, "\n");
            }
        }
        String htmlFooter = FileUtils.readContent(new File(params.pageFooter), "\n");
        final String links = sb.toString();
        final String header = MessageFormat.format(htmlHeader, Constants.FULL_NAME, links);
        String links = sb.toString();
        String header = MessageFormat.format(htmlHeader, Constants.FULL_NAME, links);
        if (!StringUtils.isEmpty(params.analyticsSnippet)) {
            File snippet = new File(params.analyticsSnippet);
            if (snippet.exists()) {
                String htmlSnippet = FileUtils.readContent(snippet, "\n");
                header = header.replace("<!-- ANALYTICS -->", htmlSnippet);
            }
        }
        final String date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        final String footer = MessageFormat.format(htmlFooter, "generated " + date);
        for (File file : markdownFiles) {
@@ -128,6 +143,9 @@
                    OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(
                            new File(destinationFolder, fileName)), Charset.forName("UTF-8"));
                    writer.write(header);
                    if (!StringUtils.isEmpty(htmlAdSnippet)) {
                        writer.write(htmlAdSnippet);
                    }
                    writer.write(content);
                    writer.write(footer);
                    reader.close();
@@ -179,6 +197,12 @@
        @Parameter(names = { "--pageFooter" }, description = "Page Footer HTML Snippet", required = true)
        public String pageFooter;
        @Parameter(names = { "--adSnippet" }, description = "Ad HTML Snippet", required = false)
        public String adSnippet;
        @Parameter(names = { "--analyticsSnippet" }, description = "Analytics HTML Snippet", required = false)
        public String analyticsSnippet;
        @Parameter(names = { "--skip" }, description = "Filename to skip", required = false)
        public List<String> skips = new ArrayList<String>();