-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
78 lines (73 loc) · 2.34 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
module.exports = function(grunt) {
let dist_path = "../ciecode.es/";
grunt.initConfig({
copy: {
dist: {
files: [
{expand: true, cwd: "src/assets/images/", src: ["**/*"], dest: dist_path + "assets/images/"},
{expand: true, cwd: "src/assets/", src: ["**/*.png"], dest: dist_path + "assets/"},
{expand: true, cwd: "src/assets/", src: ["**/*.ico"], dest: dist_path + "assets/"},
{expand: true, cwd: "src/assets/", src: ["manifest.json"], dest: dist_path + "assets/"},
{expand: true, cwd: "src/assets/fonts/", src: ["*"], dest: dist_path + "assets/fonts/"},
{expand: true, cwd: "src/assets/css/", src: ["**/*.css"], dest: dist_path + "assets/css/"},
{expand: true, cwd: "src/assets/js/", src: ["**/*.js"], dest: dist_path + "assets/js/"},
{expand: true, cwd: "src/assets/documents/", src: ["**/*"], dest: dist_path + "assets/documents/"},
{expand: true, cwd: "src/", src: ["robots.txt"], dest: dist_path}
]
}
},
sass: {
dist: {
files: {
"../ciecode.es/assets/css/style.css": "src/assets/sass/style.scss"
}
}
},
ejs_static: {
dist: {
options: {
dest: dist_path,
path_to_data: "src/data/routes.json",
path_to_layouts: "src/layouts",
index_page: "home",
parent_dirs: true,
underscores_to_dashes: true,
file_extension: ".html"
}
}
},
xml_sitemap: {
default_options: {
options: {
dest: dist_path,
siteRoot: "http://ciecode.es"
},
files: [
{
expand: false,
cwd: dist_path,
src: [
"**/*.html"
]
}
]
}
},
watch: {
datachanges: {
files: ["src/data/**/*.json", "src/layouts/**/*.ejs"],
tasks: ["ejs_static:dist"]
},
sasschanges: {
files: ["src/assets/sass/*.scss"],
tasks: ["sass:dist"]
}
}
});
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-sass");
grunt.loadNpmTasks("grunt-ejs-static");
grunt.loadNpmTasks("grunt-xml-sitemap");
grunt.registerTask("default", ["copy", "sass", "ejs_static", "xml_sitemap", "watch"]);
}