diff --git a/nifi-site/Gruntfile.js b/nifi-site/Gruntfile.js index 731b17241b..baa4c218c4 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: "\n" + + "" + }] + } + }, 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']); }; diff --git a/nifi-site/package.json b/nifi-site/package.json index 92304efbfd..f2ad8ca9f1 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" + } + ] } diff --git a/nifi-site/src/pages/html/rest-api.hbs b/nifi-site/src/pages/html/rest-api.hbs index 34e8fa6e40..7efb462e5c 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 ---