-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfractal.js
93 lines (81 loc) · 2.24 KB
/
fractal.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
'use strict';
const fractal = require('@frctl/fractal').create();
const path = require('path');
const packageInfo = require('./package.json');
const mandelbrot = require('@frctl/mandelbrot');
/**
* Require additional fractal modules
*/
const twigAdapter = require('@frctl/twig');
/*
* Give your project a title.
*/
fractal.set('project.title', 'City of Ghent Style Guide');
fractal.set('plugins.web.build.root', 'v3');
fractal.set('project.version', packageInfo.version);
/*
* Tell Fractal where to look for components.
*/
fractal.components.set('path', path.join(__dirname, 'components'));
fractal.components.set('default.preview', '@preview');
fractal.components.engine(twigAdapter);
fractal.components.set('ext', '.twig');
/*
* Set custom statuses.
*/
fractal.components.set('statuses', {
deprecated: {
label: 'deprecated',
description: 'Deprecated.',
color: 'rgb(182, 11, 41)'
},
alpha: {
label: 'alpha',
description: 'Alpha software can be unstable and could cause crashes or data loss.',
color: '#551A8B'
},
beta: {
label: 'beta',
description: 'Work in progress. Implement with caution.',
color: '#ff9233'
},
ready: {
label: 'Ready',
description: 'Ready to implement.',
color: '#29cc29'
}
});
/*
* Tell Fractal where to look for documentation pages.
*/
fractal.docs.set('path', path.join(__dirname, 'docs'));
/*
* Tell the Fractal web preview plugin where to look for static assets.
*/
fractal.web.set('static.path', path.join(__dirname, 'public'));
fractal.web.set('static.mount', '');
fractal.web.set('builder.dest', __dirname + '/build');
/*
* Define collation defaults
*/
fractal.components.set('default.collated', true);
fractal.components.set('default.collator', function (markup, item) {
return `<!-- Start: @${item.handle} -->\n<dt>${item.label || item.name}</dt><dd>${markup}</dd>\n<!-- End: @${item.handle} -->\n`;
});
const ghentTheme = mandelbrot({
nav: ['search', 'docs', 'components'],
scripts: [
'default',
'/js/version-switch.js'
],
panels: [
'view', 'info', 'html', 'context', 'resources'
],
styles: [
'default',
'/css/fractal.css'
]
});
ghentTheme.addLoadPath(__dirname + '/fractal/theme-overrides');
fractal.web.theme(ghentTheme);
module.exports = fractal;