-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathbuild.js
61 lines (56 loc) · 2.67 KB
/
build.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
const chalk = require('chalk');
const co = require('co');
const prettyHrtime = require('pretty-hrtime');
const startTime = process.hrtime();
require('./src/header-build')()
// require('./src/gallery-build')()
//require('./src/resources-build')()
console.log('header build complete')
require('./src/table-of-styles-build')()
console.log('table of styles build complete')
require('./src/table-of-properties-build')()
console.log('table of properties build complete')
require('./src/home-build')()
console.log('home build complete')
//const componentsBuildList = require('./src/components-build-list');
//const componentsBuildIndex = require('./src/components-build-index');
//const componentsBuildRSS = require('./src/components-build-rss');
//const componentsBuildPages = require('./src/components-build-pages');
//const componentsBuildScreenshots = require('./src/components-build-screenshots');
// See src/components-build-defaults for list of options that can be overriden
const options = {
components: {
// globPattern: 'src/components/article**/*.html',
// frontMatter: {
// bodyClass: 'bg-red',
// screenshot: {
// autocrop: false,
// },
// },
},
// screenshot: {
// aspectRatio: '16x9',
// },
};
// Note that componentsBuildList() generates a temporary components list (saved as JSON),
// which is re-used by later steps (for performance).
// If you are working on one component, uncomment and set components.GlobPattern
// in the options above to only (re-)generate the list, index, pages, and screenshots for the
// corresponding category. Once you are done, comment components.GlobPattern back, comment
// the line below that generate the screenshots, then run the script -- this will
// re-create the full index pages for all components, re-generate all the pages (since they need
// to cross-reference the new component), and use the previously generated screenshots as well
// as the new one (i.e. no need to re-generate *all* the screenshots unless you made
// modifications to the screenshots script itself).
co(function* generator() {
//yield componentsBuildList(options); // <- builds temporary components list (JSON)
//yield componentsBuildIndex(options); // <- builds index pages (by category & most recent)
//yield componentsBuildRSS(options); // <- builds RSS feed
//yield componentsBuildPages(options); // <- comment to skip building pages
//yield componentsBuildScreenshots(options); // <- comment to skip building screenshots
}).then(() => {
const elapsed = process.hrtime(startTime);
console.log(chalk.green('All done'), chalk.dim(prettyHrtime(elapsed)));
}).catch((err) => {
console.log(err);
});