-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulp-full.js
30 lines (22 loc) · 1.34 KB
/
gulp-full.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
const gulp = require('gulp');
const gorshochek = require('../index');
const token = process.env.TOKEN;
const model = gorshochek.createModel();
const tasks = gorshochek.tasks;
gulp.task('merge-model', tasks.core.mergeModels(model, {modelPath: './examples/model.ru.json'}));
gulp.task('process-model', ['merge-model']);
gulp.task('load-from-github', ['process-model'], tasks.docs.loadSourceFromGithub(model, {token}));
gulp.task('load-from-file', ['process-model'], tasks.docs.loadSourceFromLocal(model));
gulp.task('transform-md-html', ['load-from-github', 'load-from-file'], tasks.docs.transformMdToHtml(model));
gulp.task('process-docs', ['transform-md-html']);
gulp.task('header-title', ['process-model'], tasks.page.createHeaderTitle(model));
gulp.task('header-meta', ['process-model'], tasks.page.createHeaderMeta(model));
gulp.task('breadcrumbs', ['process-model'], tasks.page.createBreadcrumbs(model));
gulp.task('page-meta', ['header-title', 'header-meta', 'breadcrumbs']);
gulp.task('sitemap-xml', ['process-model'], tasks.sitemap.createSitemapXML(model, {host: 'https://ru.bem.info'}));
gulp.task('save-model', ['process-docs', 'page-meta', 'sitemap-xml'], tasks.core.saveModel(model));
gulp.task('rsync', ['save-model'], tasks.core.rsync(model, {
dest: './data',
exclude: ['*.meta.json', 'model.json', '*.md']
}));
gulp.task('default', ['rsync']);