-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
124 lines (111 loc) · 4.15 KB
/
Gruntfile.coffee
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
###
Grunt workflow
###
mountFolder = (connect, dir) ->
return connect.static(require('path').resolve(dir))
module.exports = (grunt) ->
@loadNpmTasks('grunt-contrib-clean')
@loadNpmTasks('grunt-contrib-compass')
@loadNpmTasks('grunt-contrib-connect')
@loadNpmTasks('grunt-contrib-copy')
@loadNpmTasks('grunt-contrib-watch')
@loadNpmTasks('grunt-jekyll')
@loadNpmTasks('grunt-open')
@loadNpmTasks('grunt-webfont')
jekyllMask = '{*/,}{*/,}{*/,}*{html,js,png,jpg,jpeg}'
@initConfig
clean:
dist: ['_site', '.tmp']
afterjekyll: ['_site/node_modules', '_site/font-generation-templates', '_site/scss']
doWatch:
options:
livereload: 35728
nospawn: true
iconsapp:
files: ['images/icons_svg_source/app/*.svg']
tasks: ['webfont', 'copy']
iconsandroid:
files: ['images/icons_svg_source/android/*.svg']
tasks: ['webfont', 'copy']
iconsios:
files: ['images/icons_svg_source/ios/*.svg']
tasks: ['webfont', 'copy']
jekyll:
files: [jekyllMask, '!_site/' + jekyllMask]
tasks: ['jekyll', 'copy']
compass:
files: ['scss/{*/,}*.scss','scss/*/{*/,}*.scss']
tasks: ['compass', 'copy']
# generate 3 webfonts, one for Android system, once for iOS system, one for the app itself
webfont:
iconsapp:
src: 'images/icons_svg_source/app/*.svg'
dest: '.tmp/fonts'
destCss: 'scss/clank/icon-fonts'
options:
font: 'app-icons'
hashes: false
htmlDemo: false
stylesheet: 'scss'
relativeFontPath: '../fonts'
template: 'font-generation-templates/custom-app.css'
iconsandroid:
src: 'images/icons_svg_source/android/*.svg'
dest: '.tmp/fonts'
destCss: 'scss/clank/icon-fonts'
options:
font: 'android-icons'
hashes: false
htmlDemo: false
stylesheet: 'scss'
relativeFontPath: '../fonts'
template: 'font-generation-templates/custom-android.css'
iconsios:
src: 'images/icons_svg_source/ios/*.svg'
dest: '.tmp/fonts'
destCss: 'scss/clank/icon-fonts'
options:
font: 'ios-icons'
hashes: false
htmlDemo: false
stylesheet: 'scss'
relativeFontPath: '../fonts'
template: 'font-generation-templates/custom-ios.css'
# Copy the fonts and css in place, because Jekyll deletes them if we
# generate in the output folder directly.
copy:
fonts:
files: [
expand: true
dot: true
cwd: '.tmp/'
dest: '_site/'
src: '*/*'
]
compass:
dist:
options:
sassDir: 'scss'
require: 'susy'
cssDir: '.tmp/css'
jekyll:
dist:
options:
dest: '_site'
connect:
livereload:
options:
port: 4200
hostname: '0.0.0.0'
middleware: (connect) ->
return [
require('connect-livereload')({ port: 35728 })
mountFolder(connect, '_site')
]
open:
server:
url: 'http://localhost:4200'
@renameTask 'watch', 'doWatch'
@registerTask('watch', ['connect', 'build', 'open', 'doWatch'])
@registerTask('build', ['clean', 'webfont', 'jekyll', 'compass', 'copy', 'clean:afterjekyll'])
@registerTask('default', ['build'])