forked from bosonic/bosonic.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
137 lines (122 loc) · 3.17 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
pages: {
options: {
data: {
baseUrl: '/'
},
sortFunction: function(a, b) {
return a.order - b.order;
},
},
pages: {
options: { pageSrc: 'src/static' },
src: 'src/pages',
dest: 'dist',
layout: 'src/layouts/page.ejs',
url: ':title'
},
docs: {
src: 'src/doc',
dest: 'dist',
layout: 'src/layouts/page_with_nav.ejs',
url: ':category/:section/:title'
},
elements: {
src: 'src/elements',
dest: 'dist',
layout: 'src/layouts/element.ejs',
url: 'elements/:title'
}
},
sass: {
options: {
includePaths: ['node_modules/compass-mixins/lib']
},
dist: {
files: {
'dist/styles/main.css' : 'src/styles/main.scss'
}
}
},
copy: {
assets: { expand: true, cwd: 'src', dest: 'dist', src: ['images/**', 'scripts/**', 'styles/**.css', 'styles/fonts/**']},
core_demos: { expand: true, cwd: 'node_modules/bosonic-core-elements/demo', dest: 'dist/demos', src: '**/*' },
core_docs: { expand: true, cwd: 'node_modules/bosonic-core-elements/doc', dest: 'src/elements', src: '**/*' },
dnd_demos: { expand: true, cwd: 'node_modules/bosonic-dnd-elements/demo', dest: 'dist/demos', src: '**/*' },
dnd_docs: { expand: true, cwd: 'node_modules/bosonic-dnd-elements/doc', dest: 'src/elements', src: '**/*' },
data_demos: { expand: true, cwd: 'node_modules/bosonic-data-elements/demo', dest: 'dist/demos', src: '**/*' },
data_docs: { expand: true, cwd: 'node_modules/bosonic-data-elements/doc', dest: 'src/elements', src: '**/*' }
},
watch: {
pages: {
files: ['src/static/*.ejs', 'src/layouts/*.ejs', 'src/partials/*.ejs', 'src/**/*.md'],
tasks: ['pages']
},
sass: {
files: ['src/styles/**/*'],
tasks: ['sass']
},
assets: {
files: ['src/images/**', 'src/scripts/**', 'src/styles/**.css', 'src/styles/fonts/**'],
tasks: ['copy:assets']
},
dist: {
files: ['dist/**'],
options: {
livereload: true
}
}
},
connect: {
dist: {
options: {
port: 5455,
hostname: '*',
base: 'dist',
livereload: true
}
}
},
open: {
dist: {
path: 'http://localhost:5455'
}
},
clean: {
dist: ['dist']
},
'gh-pages': {
options: {
base: 'dist',
branch: 'master',
},
src: ['**']
}
});
grunt.registerTask('elements', [
'copy:core_demos',
'copy:core_docs',
'copy:dnd_demos',
'copy:dnd_docs',
'copy:data_demos',
'copy:data_docs'
]);
grunt.registerTask('build', [
'clean',
'elements',
'pages',
'sass',
'copy:assets'
]);
grunt.registerTask('deploy', ['build', 'gh-pages']);
grunt.registerTask('server', [
'build',
'connect',
'open',
'watch'
]);
grunt.registerTask('default', 'server');
require('load-grunt-tasks')(grunt);
};