1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2026-03-17 08:05:44 +01:00
TableFilter/Gruntfile.js
2015-09-06 15:59:56 +10:00

138 lines
3 KiB
JavaScript

/*
* Generated on 2015-09-05
* generator-assemble v0.5.0
* https://github.com/assemble/generator-assemble
*
* Copyright (c) 2015 Hariadi Hinta
* Licensed under the MIT license.
*/
"use strict";
// # Globbing
// for performance reasons we're only matching one level down:
// '<%= config.src %>/templates/pages/{,*/}*.hbs'
// use this if you want to match all subfolders:
// '<%= config.src %>/templates/pages/**/*.hbs'
module.exports = function(grunt) {
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
config: {
src: 'src',
dist: 'dist'
},
watch: {
assemble: {
files: ['<%= config.src %>/{content,data,templates}/{,*/}*.{md,hbs,yml}'],
tasks: ['assemble']
},
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= config.dist %>/{,*/}*.html',
'<%= config.dist %>/assets/{,*/}*.css',
'<%= config.dist %>/assets/{,*/}*.js',
'<%= config.dist %>/assets/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
}
},
connect: {
options: {
port: 9000,
livereload: 35729,
// change this to '0.0.0.0' to access the server from outside
hostname: 'localhost'
},
livereload: {
options: {
open: true,
base: [
'<%= config.dist %>'
]
}
}
},
assemble: {
pages: {
options: {
flatten: true,
assets: '<%= config.dist %>/assets',
layout: '<%= config.src %>/templates/layouts/default.hbs',
data: '<%= config.src %>/data/*.{json,yml}',
partials: '<%= config.src %>/templates/partials/*.hbs',
plugins: ['assemble-contrib-anchors','assemble-contrib-toc'],
},
files: {
'<%= config.dist %>/': ['<%= config.src %>/templates/pages/*.hbs']
}
}
},
copy: {
bootstrap: {
expand: true,
cwd: 'bower_components/bootstrap/dist/',
src: '**',
dest: '<%= config.dist %>/assets/'
},
theme: {
expand: true,
cwd: 'src/assets/',
src: '**',
dest: '<%= config.dist %>/assets/css/'
},
tablefilter: {
expand: true,
cwd: 'tablefilter/',
src: '**',
dest: '<%= config.dist %>/tablefilter/'
}
},
// Before generating any new files,
// remove any previously-created files.
clean: ['<%= config.dist %>/**/*.{html,xml}'],
'gh-pages': {
options: {
base: 'dist' ,
message: 'Generated by grunt gh-pages',
add: true
} ,
src: ['**/*', '!tablefilter']
}
});
grunt.loadNpmTasks('assemble');
grunt.registerTask('server', [
'build',
'connect:livereload',
'watch'
]);
grunt.registerTask('build', [
'clean',
'copy',
'assemble'
]);
grunt.registerTask('default', [
'build'
]);
grunt.registerTask ('deploy', ['gh-pages']);
};