From 9e68c3b9cad5c10eef0a24ff97026bcc1701fbbf Mon Sep 17 00:00:00 2001 From: Jurij Cherepanov Date: Fri, 22 Apr 2016 12:00:40 +0300 Subject: [PATCH 1/2] Generate index.html only once. Resolve inline partials multiple tasks bug when generates same index.html multiple times - embedded partials are cleaned. --- tasks/grunt-ngdocs.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tasks/grunt-ngdocs.js b/tasks/grunt-ngdocs.js index a6b4cb4..e37b9c7 100644 --- a/tasks/grunt-ngdocs.js +++ b/tasks/grunt-ngdocs.js @@ -19,6 +19,8 @@ var repohosts = [ } ]; +var generatedIndexes = {}; + module.exports = function(grunt) { var _ = grunt.util._, unittest = {}, @@ -222,9 +224,13 @@ module.exports = function(grunt) { template = options.template ? options.template : path.resolve(templates, 'index.tmpl'); // create index.html - content = grunt.file.read(template); - content = grunt.template.process(content, {data:data}); - grunt.file.write(path.resolve(options.dest, 'index.html'), content); + var indexFile = path.resolve(options.dest, 'index.html'); + if (!generatedIndexes[indexFile]) { + content = grunt.file.read(template); + content = grunt.template.process(content, {data:data}); + grunt.file.write(indexFile, content); + generatedIndexes[indexFile] = true; + } // create setup file setup.html5Mode = options.html5Mode; From eea051cea0e81bf0670e53f92d9ca712d75c4116 Mon Sep 17 00:00:00 2001 From: cheplv Date: Tue, 23 May 2017 19:45:12 +0300 Subject: [PATCH 2/2] Fix non html5 mode angular urls --- src/ngdoc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ngdoc.js b/src/ngdoc.js index 4fdc9f5..2a4d362 100644 --- a/src/ngdoc.js +++ b/src/ngdoc.js @@ -156,7 +156,7 @@ Doc.prototype = { * @returns {string} Absolute url */ convertUrlToAbsolute: function(url) { - var prefix = this.options.html5Mode ? '' : '#/'; + var prefix = this.options.html5Mode ? '' : '#!/'; var hashIdx = url.indexOf('#'); // Lowercase hash parts of the links,