module.exports = function smithy(dir, filepath) { var app = assemble(); app.use(runtimes()); app.engine('*', require('engine-handlebars')); app.onLoad(/./, function (view, next) { matter.parse(view, next); }); app.create('files', {engine: '*'}); toViews(dir, filepath, function (fp, opts) { app.files.addView(toFile(fp, opts)); }); app.task('default', function() { return app.toStream('files') .pipe(app.renderFile('*')) .pipe(extname()) .pipe(app.dest('build')) }); app.build = app.build.bind(app, 'default'); return app; };
var assemble = require('../..'); var app = assemble(); /** * Logo out files as they're rendered */ app.on('preRender', function(view) { console.log(' rendering >', view.relative); }); /** * Add the loaders and runtimes plugins */ app.use(runtimes()); app.use(loader()); /** * Register a template engine for rendering templates */ app.engine('*', require('engine-handlebars')); /** * Create a custom template (view) collection */ app.create('layouts', { viewType: 'layout', renameKey: function(key) {