This repository has been archived by the owner on Jul 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Gruntfile.js
59 lines (56 loc) · 1.78 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
tree: {
default: {
options: {},
files: [
{
src: ['src/content/wiki'],
dest: 'src/temp/wiki_navigation.json'
}
]
}
},
'compile-handlebars': {
wiki: {
files: [{
src: 'src/templates/partials/sidenavs/nav.handlebars',
dest: 'src/templates/temp/nav.html'
}],
helpers: ['handlebars-helpers', 'src/templates/helpers/*.js'],
partials: 'src/templates/partials/sidenavs/*.html',
templateData: 'src/temp/wiki_navigation.json'
}
},
site: {
public: {
options: {
templates: 'templates',
defaultTemplate: 'full.html'
},
src: 'src',
dest: 'out'
}
},
clean: ['src/temp', 'src/templates/temp'],
copy: {
assets: {
expand: true,
cwd: 'src/assets',
src: '**',
dest: 'out/assets'
}
}
});
var handlebars = require('handlebars');
var helpers = require('handlebars-helpers')({
handlebars: handlebars
});
grunt.loadNpmTasks('grunt-tree');
grunt.loadNpmTasks('grunt-compile-handlebars');
grunt.loadNpmTasks('grunt-site');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['tree', 'compile-handlebars', 'site', 'clean', 'copy']);
}