summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/generator.js2
-rw-r--r--lib/generators/site.js5
-rw-r--r--test/fixtures/test0/styles/website.css3
-rw-r--r--test/generation.js9
4 files changed, 13 insertions, 6 deletions
diff --git a/lib/generator.js b/lib/generator.js
index a16af16..ab45987 100644
--- a/lib/generator.js
+++ b/lib/generator.js
@@ -46,7 +46,7 @@ BaseGenerator.prototype.writeParsedFile = function(page, input) {
// Copy file to the output (non parsable)
BaseGenerator.prototype.transferFile = function(input) {
return fs.copy(
- path.join(this.options.input, input),
+ path.join(this.book.root, input),
path.join(this.options.output, input)
);
};
diff --git a/lib/generators/site.js b/lib/generators/site.js
index ffcd005..d05e322 100644
--- a/lib/generators/site.js
+++ b/lib/generators/site.js
@@ -87,11 +87,6 @@ Generator.prototype.prepareTemplates = function() {
return Q();
};
-// Ignore some methods
-Generator.prototype.transferFile = function(input) {
-
-};
-
// Finis generation
Generator.prototype.finish = function() {
return this.copyAssets()
diff --git a/test/fixtures/test0/styles/website.css b/test/fixtures/test0/styles/website.css
new file mode 100644
index 0000000..f0d5b13
--- /dev/null
+++ b/test/fixtures/test0/styles/website.css
@@ -0,0 +1,3 @@
+body {
+ background: red;
+}
diff --git a/test/generation.js b/test/generation.js
index 1d73068..a8f9c69 100644
--- a/test/generation.js
+++ b/test/generation.js
@@ -54,4 +54,13 @@ describe('Book generation', function () {
assert(fs.existsSync(path.join(output, "index.html")));
}, done);
});
+
+ it('should correctly include styles in website', function(done) {
+ testGeneration(books[0], "site", function(output) {
+ assert(fs.existsSync(path.join(output, "styles/website.css")));
+
+ var INDEX = fs.readFileSync(path.join(output, "index.html")).toString();
+ assert(INDEX.indexOf("styles/website.css") > 0);
+ }, done);
+ });
});