Skip to content

Commit 79ca026

Browse files
committed
#29 - only hash the searchMap
1 parent 7c15a34 commit 79ca026

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

generate.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ module.exports = function(docMapPromise, siteConfig){
5151
var searchMapPromise = docMapPromise.then(function(docMap){
5252
return write.searchMap(docMap, siteConfig);
5353
});
54-
var docMapHash = docMapPromise.then(function(docMap){
55-
return write.docMapHash(docMap, siteConfig);
54+
var searchMapHashPromise = searchMapPromise.then(function(searchMap){
55+
return write.docMapHash(searchMap, siteConfig);
5656
});
5757

5858
var docsPromise = Q.all([
@@ -61,7 +61,7 @@ module.exports = function(docMapPromise, siteConfig){
6161
helpersReadyPromise,
6262
mkdirs(siteConfig.dest),
6363
searchMapPromise,
64-
docMapHash
64+
searchMapHashPromise
6565
]).then(function(results){
6666
var docMap = results[0],
6767
renderer = results[1];

write/doc_map_hash.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ var fs = require('fs'),
99
* @function bitDocs.generators.html.write.docMapHash
1010
* @parent bitDocs.generators.html.write.methods
1111
*
12-
* Writes out file containing an md5 hash of the docmap
12+
* Writes out file containing an md5 hash of a docMap-like object
13+
* (docMap or subset of a docMap)
1314
*
1415
* @signature `.write.docMapHash(docMap, siteConfig)`
1516
*
@@ -22,9 +23,11 @@ module.exports = function(docMap, siteConfig) {
2223
hash: md5(JSON.stringify(docMap))
2324
},
2425
dest = path.join(siteConfig.dest, 'docMapHash.json');
25-
26+
2627
return mkdirs(siteConfig.dest).then(function(){
27-
return writeFile(dest, JSON.stringify(docMapHashConfig));
28+
return writeFile(dest, JSON.stringify(docMapHashConfig)).then(function(){
29+
return docMapHashConfig;
30+
});
2831
});
2932

3033
};

write/search_map.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ module.exports = function(docMap, siteConfig) {
3737
var dest = path.join(siteConfig.dest, 'searchMap.json');
3838

3939
return mkdirs(siteConfig.dest).then(function(){
40-
return writeFile(dest, JSON.stringify(searchMap));
40+
return writeFile(dest, JSON.stringify(searchMap)).then(function(){
41+
return searchMap;
42+
});
4143
});
4244

4345
};

0 commit comments

Comments
 (0)