-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.js
More file actions
30 lines (23 loc) · 648 Bytes
/
example.js
File metadata and controls
30 lines (23 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
'use strict';
var path = require('path');
var each = require('./each');
var assemble = require('assemble');
var app = assemble();
var src = path.join.bind(path, __dirname, 'src');
app.use(each());
app.create('includes', {viewType: 'partial'});
app.create('posts');
app.includes(src('_includes/*'));
app.partials(src('_includes/*'));
app.layouts(src('_layouts/*'));
app.posts(src('_posts/*'));
app.pages(src('_pages/*'));
app.each(function(collection, key, cb) {
console.log(collection);
collection.each(function(view, key, next) {
console.log(view);
next();
}, cb);
}, function callback(err) {
if (err) console.log(err);
});