forked from metalsmith/metalsmith
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
40 lines (31 loc) · 648 Bytes
/
Copy pathbuild.js
File metadata and controls
40 lines (31 loc) · 648 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var extname = require('path').extname;
var Metalsmith = require('metalsmith');
var myth = require('myth');
/**
* Build.
*/
var metalsmith = Metalsmith(__dirname)
.use(concat)
.build(function(err){
if (err) throw err;
});
/**
* Concat plugin.
*
* @param {Object} files
* @param {Metalsmith} metalsmith
* @param {Function} done
*/
function concat(files, metalsmith, done){
var css = '';
for (var file in files) {
if ('.css' != extname(file)) continue;
css += files[file].contents.toString();
delete files[file];
}
css = myth(css);
files['index.css'] = {
contents: new Buffer(css)
};
done();
}