-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.js
40 lines (34 loc) · 853 Bytes
/
build.js
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
/*
adleria.com (c) 2016 Optimal Bits Sweden AB.
*/
var marlin = require('marlin');
var handlebars = require('handlebars'),
layouts = require('handlebars-layouts');
handlebars.registerHelper(layouts(handlebars));
//
// Register handlebars template engine.
//
marlin.register(function(src, ctx){
var template = handlebars.compile(src);
return template(ctx);
}, function(name, src){
handlebars.registerPartial(name, src);
}, ['hbs'], 'html');
//
// Register Sass css preprocessor
//
var sass = require('node-sass');
marlin.register(function(src, ctx){
var result = sass.renderSync({
data: src,
includePaths: [
'./scss',
'./partials'
],
//outputStyle: 'compressed'
});
return result.css;
}, null, ['scss'], 'css');
marlin.build('./', 'build').then(function(site){
console.log('marlin: site:', site);
});