Repository: incubator-nifi Updated Branches: refs/heads/develop b70845b31 -> e1aa4890a
NIFI-592: - Adding Google Analytics to generated documentation being deployed to the website. Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/81e40d43 Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/81e40d43 Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/81e40d43 Branch: refs/heads/develop Commit: 81e40d43480cc42a4e8e9edf1a6360c1a54449db Parents: 251f0e5 Author: Matt Gilman <[email protected]> Authored: Wed May 6 10:04:18 2015 -0400 Committer: Matt Gilman <[email protected]> Committed: Wed May 6 10:04:18 2015 -0400 ---------------------------------------------------------------------- nifi-site/Gruntfile.js | 23 ++++++++++++-- nifi-site/package.json | 49 ++++++++++++++++-------------- nifi-site/src/pages/html/rest-api.hbs | 2 +- 3 files changed, 48 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/81e40d43/nifi-site/Gruntfile.js ---------------------------------------------------------------------- diff --git a/nifi-site/Gruntfile.js b/nifi-site/Gruntfile.js index 731b172..baa4c21 100644 --- a/nifi-site/Gruntfile.js +++ b/nifi-site/Gruntfile.js @@ -77,7 +77,7 @@ module.exports = function (grunt) { dest: 'dist/docs/', rename: function (dest, src) { var path = require('path'); - + if (src.indexOf('images') > 0) { return path.join(dest, 'rest-api/images', path.basename(src)); } else { @@ -129,6 +129,24 @@ module.exports = function (grunt) { stderr: true } }, + replace: { + addGoogleAnalytics: { + src: ['dist/docs/*.html', 'dist/docs/rest-api/index.html'], + overwrite: true, + replacements: [{ + from: /<\/head>/g, + to: "<script>\n" + + "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n" + + "(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n" + + "m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n" + + "})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n" + + "ga('create', 'UA-57264262-1', 'auto');\n" + + "ga('send', 'pageview');\n" + + "</script>\n" + + "</head>" + }] + } + }, watch: { grunt: { files: ['Gruntfile.js'], @@ -161,11 +179,12 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-compass'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-exec'); + grunt.loadNpmTasks('grunt-text-replace'); grunt.registerTask('img', ['newer:copy']); grunt.registerTask('css', ['clean:css', 'compass']); grunt.registerTask('js', ['clean:js', 'concat']); - grunt.registerTask('generate-docs', ['clean:generated', 'exec:generateDocs', 'exec:generateRestApiDocs', 'copy:generated']); + grunt.registerTask('generate-docs', ['clean:generated', 'exec:generateDocs', 'exec:generateRestApiDocs', 'copy:generated', 'replace:addGoogleAnalytics']); grunt.registerTask('default', ['clean', 'assemble', 'css', 'js', 'img', 'generate-docs', 'copy:dist']); grunt.registerTask('dev', ['default', 'watch']); }; http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/81e40d43/nifi-site/package.json ---------------------------------------------------------------------- diff --git a/nifi-site/package.json b/nifi-site/package.json index 92304ef..f2ad8ca 100644 --- a/nifi-site/package.json +++ b/nifi-site/package.json @@ -1,25 +1,28 @@ { - "name": "apache-nifi-site", - "version": "0.0.2-incubating", - "description": "The artifacts for the Apache NiFi site.", - "private": "true", - "repository": { - "type": "git", - "url": "http://git-wip-us.apache.org/repos/asf/incubator-nifi.git" - }, - "devDependencies": { - "assemble": "^0.4.42", - "grunt": "^0.4.5", - "grunt-contrib-clean": "^0.6.0", - "grunt-contrib-compass": "^1.0.1", - "grunt-contrib-concat": "^0.5.0", - "grunt-contrib-copy": "^0.7.0", - "grunt-contrib-watch": "^0.6.1", - "grunt-exec": "^0.4.6", - "grunt-newer": "^1.1.0" - }, - "licenses": [{ - "type": "Apache", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }] + "name": "apache-nifi-site", + "version": "0.0.2-incubating", + "description": "The artifacts for the Apache NiFi site.", + "private": "true", + "repository": { + "type": "git", + "url": "http://git-wip-us.apache.org/repos/asf/incubator-nifi.git" + }, + "devDependencies": { + "assemble": "^0.4.42", + "grunt": "^0.4.5", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-compass": "^1.0.1", + "grunt-contrib-concat": "^0.5.0", + "grunt-contrib-copy": "^0.7.0", + "grunt-contrib-watch": "^0.6.1", + "grunt-exec": "^0.4.6", + "grunt-newer": "^1.1.0", + "grunt-text-replace": "^0.4.0" + }, + "licenses": [ + { + "type": "Apache", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + ] } http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/81e40d43/nifi-site/src/pages/html/rest-api.hbs ---------------------------------------------------------------------- diff --git a/nifi-site/src/pages/html/rest-api.hbs b/nifi-site/src/pages/html/rest-api.hbs index 34e8fa6..7efb462 100644 --- a/nifi-site/src/pages/html/rest-api.hbs +++ b/nifi-site/src/pages/html/rest-api.hbs @@ -1,5 +1,5 @@ --- -title: Apache NiFi Developer Guide +title: Apache NiFi Rest Api --- <div class="external-guide">
