-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
54 lines (50 loc) · 1.39 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
extend = require('extend')
module.exports = (grunt) ->
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt);
# Pull remote php content to local html content
host = 'http://192.168.222.180'
pages = ['landing', 'feature', 'case', 'signup'];
httpConfig = {}
pages.forEach (page) ->
httpConfig[page] =
options:
url: "#{host}/site/#{page}"
callback: (error, response, body) ->
grunt.file.write("#{page}.html", body.replace(/\/build\/landing\/css/g, 'assets'))
cssFileConfig =
css:
options:
url: "#{host}/build/landing/css/app.css",
callback: (error, response, body) ->
grunt.file.write('assets/app.css', body.replace(/\/build\/landing\/fonts/g, '../fonts'));
httpConfig = extend(httpConfig, cssFileConfig)
grunt.initConfig
'font-spider':
options: {}
main:
src: ['./*.html', '!./index.html']
clean:
fonts: ['fonts/*']
assets: ['*.html', '!index.html', 'assets', 'fonts/.font-spider']
copy:
main:
expand: true
cwd: 'fonts/.font-spider/'
src: '*'
dest: 'fonts'
ext: '.ttf'
fonts:
expand: true
cwd: 'fonts'
src: '*'
dest: 'latest'
http: httpConfig
grunt.registerTask('default', [
'http',
'font-spider',
'copy:fonts',
'clean:fonts',
'copy:main'
'clean:assets'
])