Last active
August 29, 2015 14:13
-
-
Save andymantell/1bd1e0fb5f8d659bf11f to your computer and use it in GitHub Desktop.
Assemble 0.6 custom grunt task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var assemble = require('assemble'); | |
| var ext = require('gulp-extname'); | |
| module.exports = function(grunt) { | |
| grunt.registerTask('assemble', 'Assemble', function() { | |
| var done = this.async(); | |
| var site = assemble.init(); | |
| site.partials('src/core/templates/partials/**/*.hbs'); | |
| site.layouts('src/core/templates/layouts/*.hbs'); | |
| site.option('layout', 'default'); | |
| // Dummy helpers to stop errors being thrown for the moment | |
| site.helper('author', function() {return 'here'}); | |
| site.helper('button', function() {return 'here'}); | |
| site.helper('byline', function() {return 'here'}); | |
| site.helper('compile', function() {return 'here'}); | |
| site.helper('debug', function() {return 'here'}); | |
| site.helper('icon', function() {return 'here'}); | |
| site.helper('ifCond', function() {return true}); | |
| site.helper('image', function() {return 'here'}); | |
| site.helper('loadArticle', function() {return []}); | |
| site.helper('loadAuthorArticles', function() {return []}); | |
| site.helper('navigation', function() {return 'here'}); | |
| site.helper('panel', function() {return 'here'}); | |
| site.helper('parseJSON', function() {return []}); | |
| site.helper('render', function() {return 'here'}); | |
| site.helper('renderJSON', function() {return 'here'}); | |
| site.helper('teamFiller', function() {return ''}); | |
| // Build the pattern library | |
| site.task('demo', function() { | |
| site | |
| .src('src/sites/demo/pages/**/*.hbs') | |
| .pipe(ext()) | |
| .pipe(site.dest('converted-html/demo')); | |
| }); | |
| // Build the main site | |
| site.task('main', function() { | |
| site | |
| .src('src/sites/main/pages/**/*.hbs') | |
| .pipe(ext()) | |
| .pipe(site.dest('converted-html/main')); | |
| }); | |
| site.run(['demo', 'main'], done); | |
| }); | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hooray! That's pretty much sort of working now :-) It's all kinds of broken still, but that's to be expected - I still need to migrate all my helpers and I daresay fix a few other things but this is a darn good start - it gets about halfway through rendering now and the output all looks correctish and well formed. So, now I just need to finish the migration...
Thankyou so much for your help, is massively appreciated. I'll keep you posted on my progress... :-)