This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
forked from agalitsyn/presentations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
112 lines (105 loc) · 2.07 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
var fs = require('fs');
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
files: ['src/js/reveal.js'],
options: {}
},
copy: {
app: {
files: [{
expand: true,
cwd: 'src',
src: ['js/**', 'css/**', 'images/**'],
dest: 'dist/'
}]
}
},
template: {
app: {
options: {
data: {
title: 'presentation-title',
content: fs.readFileSync('src/slides.md').toString()
}
},
files: {
'dist/index.html': ['src/layout.html']
}
}
},
connect: {
dist: {
options: {
port: 5455,
hostname: 'localhost',
middleware: function (connect) {
return [
require('grunt-contrib-livereload/lib/utils').livereloadSnippet,
connect.static(require('path').resolve('dist'))
];
}
}
}
},
open: {
dist: {
path: 'http://localhost:5455',
app: 'xdg-open'
}
},
clean: {
dist: 'dist'
},
watch: {
dist: {
files: ['dist/**'],
options: {
livereload: true
}
},
copy: {
files: [
'src/js/**',
'src/css/**',
'src/images/**'
],
tasks: ['copy']
},
template: {
files: [
'src/slides.md',
'src/layout.html'
],
tasks: ['template']
}
},
mkcouchdb: {
app: require('./couchapp.json')
},
couchapp: {
app: require('./couchapp.json')
}
});
// Load plugins
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Default task(s).
grunt.registerTask('build', [
'clean',
'copy',
'template'
]);
grunt.registerTask('deploy', [
'build',
'mkcouchdb',
'couchapp'
]);
grunt.registerTask('server', [
'build',
'connect',
'open',
'watch'
]);
};