-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgulpfile.js
47 lines (43 loc) · 1.24 KB
/
gulpfile.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
var gulp = require('gulp');
var matter = require('gulp-front-matter');
var marked = require('gulp-marked');
var layout = require('gulp-layoutize');
var sass = require('gulp-sass');
var replace = require('gulp-replace');
var swig = require('swig');
gulp.task('pages:md', function () {
return gulp.src(['./*.md', '!README.md'])
.pipe(matter({property: 'page', remove: true}))
.pipe(marked())
.pipe(layout({
templatePath: './_layouts/default.html',
engine: 'swig',
locals: {}
}))
.pipe(replace(/ id="-"/g, ' id="section"'))
.pipe(gulp.dest('export'));
});
gulp.task('activities', function () {
return gulp.src(['./_activities/*.md'])
.pipe(matter({property: 'page', remove: true}))
.pipe(marked())
.pipe(layout({
templatePath: './_layouts/default.html',
engine: 'swig',
locals: {}
}))
.pipe(replace(/ id="-"/g, ' id="section"'))
.pipe(gulp.dest('export/activities'));
});
gulp.task('style', function () {
return gulp.src(['./*.scss'])
.pipe(matter({remove: true}))
.pipe(sass({
"outputStyle": "expanded",
"includePaths": ["_sass"]
}))
.pipe(gulp.dest('export'));
});
gulp.task('pages', ['pages:md']);
gulp.task('build', ['pages', 'activities', 'style']);
gulp.task('default', ['pages', 'activities', 'style']);