-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
121 lines (104 loc) · 2.68 KB
/
Gruntfile.js
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
* Generated on 2014-11-15
* generator-assemble v0.5.0
* https://github.com/assemble/generator-assemble
*
* Copyright (c) 2014 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-permalinks','assemble-contrib-sitemap'],
},
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/'
}
},
// Before generating any new files,
// remove any previously-created files.
clean: ['<%= config.dist %>/**/*.{html,xml}']
});
grunt.loadNpmTasks('assemble');
grunt.registerTask('server', [
'build',
'connect:livereload',
'watch'
]);
grunt.registerTask('build', [
'clean',
'copy',
'assemble'
]);
grunt.registerTask('default', [
'build'
]);
};