forked from mozilla/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fractal.config.js
67 lines (55 loc) · 1.82 KB
/
fractal.config.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
'use strict';
// Require the path module
const path = require('path');
// Require the Fractal module
const fractal = module.exports = require('@frctl/fractal').create();
// Require Nunjucks
const nunjucks = require('@frctl/nunjucks');
const pkg = require(path.join(__dirname, 'package.json'));
// Set the title
fractal.set('project.title', 'Mozilla Protocol');
// Provide the package.json 'version' to the templates
fractal.set('project.version', pkg.version);
// Server configuration
fractal.web.set('server.port', 3000);
fractal.web.set('server.sync', true);
fractal.web.set('debug', true);
// Configure components
fractal.components.engine(nunjucks);
fractal.components.set('ext', '.html');
fractal.components.set('path', path.join(__dirname, 'components'));
fractal.components.set('default.status', null);
fractal.components.set('statuses', {
deprecated: {
label: 'Deprecated',
description: 'Deprecated component slated for removal.',
color: 'firebrick'
},
wip: {
label: 'WIP',
description: 'Work in progress, not yet ready for use.',
color: 'darkorange'
}
});
// Configure documentation pages
fractal.docs.set('ext', '.md');
fractal.docs.set('path', path.join(__dirname, 'docs'));
fractal.docs.set('statuses', {
outdated: {
label: 'Outdated',
description: 'Outdated documentation, needs updating.',
color: 'firebrick'
},
draft: {
label: 'Draft',
description: 'Draft documentation, work in progress.',
color: 'darkorange'
}
});
// Tell Fractal where to look for static assets.
fractal.web.set('static.path', path.join(__dirname, 'static'));
// Tell Fractal where to build the site.
fractal.web.set('builder.dest', path.join(__dirname, 'dist'));
// Custom theme
const theme = require('./theme');
fractal.web.theme(theme);