Skip to content

Commit 0263d43

Browse files
lookup new keys for metalsmith > v1.0
1 parent 01f0836 commit 0263d43

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@
4747
},
4848

4949
compileSass = function compileSass(files, metalsmith, done) {
50-
var basePath = path.join(metalsmith.dir, metalsmith._src);
50+
/**
51+
* Looks up different key names on `metalsmith` to support
52+
* old versions (< v1) of Metalsmith. At some point, I will remove
53+
* support for < v1 and remove the key lookups
54+
*/
55+
var directory = metalsmith.dir || metalsmith._directory,
56+
source = metalsmith._src || metalsmith._source,
57+
basePath = path.join(directory, source);
5158
each(Object.keys(files), compile.bind(this, basePath, files), done);
5259
},
5360

0 commit comments

Comments
 (0)