Skip to content

Commit bc74e93

Browse files
committed
created assemblefile.js
1 parent a3979d5 commit bc74e93

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

assemblefile.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
'use strict';
2+
3+
var assemble = require('assemble');
4+
var extname = require('gulp-extname');
5+
var path = require('path');
6+
var helpers = require('handlebars-helpers');
7+
var compare = helpers.comparison();
8+
var pkg = require('./package');
9+
10+
var app = assemble();
11+
12+
app.task('init', function(cb) {
13+
app.helper('md', require('helper-md').sync);
14+
app.helper('is', compare);
15+
app.helper('markdown', require('helper-markdown'));
16+
app.data('pkg', pkg);
17+
app.data(['./src/templates/data/**/*.{json,yml}']);
18+
// app.data('analytic','UA-23581568-13');
19+
app.layouts(path.join(__dirname, './src/templates/layouts/*.hbs'));
20+
app.partials(path.join(__dirname, './src/templates/partials/**/*.hbs'));
21+
app.pages(path.join(__dirname, './src/templates/pages/*.hbs'));
22+
app.option('layout', 'default');
23+
cb();
24+
});
25+
26+
app.task('html:rtl', ['init'], function() {
27+
app.data('assets', '../assets');
28+
app.data('rtl', true);
29+
return app.toStream('pages')
30+
.pipe(app.renderFile())
31+
.pipe(extname())
32+
.pipe(app.dest('public/rtl'));
33+
});
34+
35+
app.task('html', ['init'], function() {
36+
app.data('assets', 'assets');
37+
return app.toStream('pages')
38+
.pipe(app.renderFile())
39+
.pipe(extname())
40+
.pipe(app.dest('public'));
41+
});
42+
43+
app.task('default', ['html', 'html:rtl']);
44+
45+
module.exports = app;

0 commit comments

Comments
 (0)