diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-25 21:13:17 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-25 21:13:17 +0200 |
commit | c34a9f6213c204c43c78dd691a5295d7e5a757e8 (patch) | |
tree | 96f287daa52ade759b7b0e635b6e36dea7acaf86 /lib/models | |
parent | f5df41c75f6e6d25ffc9f86feeac29892fb9f856 (diff) | |
download | gitbook-c34a9f6213c204c43c78dd691a5295d7e5a757e8.zip gitbook-c34a9f6213c204c43c78dd691a5295d7e5a757e8.tar.gz gitbook-c34a9f6213c204c43c78dd691a5295d7e5a757e8.tar.bz2 |
Copy assets from themes to output folder
Diffstat (limited to 'lib/models')
-rw-r--r-- | lib/models/fs.js | 7 | ||||
-rw-r--r-- | lib/models/page.js | 9 |
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/models/fs.js b/lib/models/fs.js index 2400ff2..c74f3cd 100644 --- a/lib/models/fs.js +++ b/lib/models/fs.js @@ -182,7 +182,7 @@ FS.prototype.listAllFiles = function(folder) { var isDirectory = pathIsFolder(file); if (!isDirectory) { - return out.push(file); + return out.push(path.join(folder, file)); } return that.listAllFiles(path.join(folder, file)) @@ -190,11 +190,6 @@ FS.prototype.listAllFiles = function(folder) { return out.concat(inner); }); }, Immutable.List()); - }) - .then(function(files) { - return files.map(function(file) { - return path.join(folder, file); - }); }); }; diff --git a/lib/models/page.js b/lib/models/page.js index 0a9cf38..ffb9601 100644 --- a/lib/models/page.js +++ b/lib/models/page.js @@ -32,6 +32,15 @@ Page.prototype.getDir = function() { }; /** + Return path of the page + + @return {String} +*/ +Page.prototype.getPath = function() { + return this.getFile().getPath(); +}; + +/** Create a page for a file @param {File} file |