This repository has been archived by the owner on Oct 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
115 lines (101 loc) · 3.3 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
module.exports = function(grunt) {
grunt.initConfig({
eslint: {
options: {
configFile: '.eslintrc.js',
fix: true
},
target: [
'./src/js/**/*.js',
'Gruntfile.js',
]
},
watch: {
javascript: {
expand: true,
files: ['./src/js/**/*.js', 'Gruntfile.js'],
tasks: ['eslint'],
options: {
spawn: false
}
},
docs: {
expand: true,
files: ['./docs-md/**/*.md'],
tasks: ['buildDocs'],
options: {
spawn: false
}
}
},
googlefonts: {
build: {
options: {
fontPath: './src/font/webFonts',
cssFile: './src/scss/partials/_webFonts.scss',
httpPath: '../font/webFonts/',
formats: {eot: true, ttf: true, woff: true, woff2: false, svg: true},
fonts: [{
family: 'Archivo Narrow',
subsets: ['latin-ext'],
styles: [400, '400italic', 700, '700italic']
}, {
family: 'Roboto',
subsets: ['latin-ext'],
styles: [400, '400italic', 700, '700italic']
}]
}
}
},
bump: {
options: {
files: ['package.json', 'package-lock.json'],
commitFiles: ['package.json', 'package-lock.json'],
tagName: '%VERSION%',
push: false
}
},
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('buildDocs', function() {
var attire = require('attire');
var done = this.async();
attire.buildDocs({
files: [
{
path: './docs-md/about.md',
emphasizeLead: true,
author: {
caption: 'Trikoder',
url: 'https://github.com/trikoder',
// image: 'https://s.gravatar.com/avatar/f5ef615518b19dbd4ea273e77030d399?s=80',
email: '[email protected]',
github: 'https://github.com/trikoder',
twitter: 'https://twitter.com/trikoder'
}
},
'./docs-md/getting-started.md',
'./docs-md/core-concepts-and-api.md',
'./docs-md/adding-resource.md',
'./docs-md/list-elements.md',
'./docs-md/form-elements.md',
'./docs-md/base-controllers.md'
],
dest: './docs/',
projectTitle: 'Trim CMF',
githubUrl: 'https://github.com/trikoder/trim',
inlineCss: false
}).then(function() {
done();
grunt.log.ok(['Docs builded']);
});
});
grunt.registerTask('default', [
'watch'
]);
grunt.registerTask('build', [
// 'googlefonts',
'eslint',
'buildDocs'
]);
};