-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfractal.config.js
76 lines (61 loc) · 2.03 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
68
69
70
71
72
73
74
75
76
'use strict';
const themeDir = 'BC__BASE';
const baseThemePath = `BC__BASE__THEMEDIR/${themeDir}/`;
const distPath = `${baseThemePath}/assets/dist/`;
const libPath = `${baseThemePath}/fractal/`;
/*
* Require the path module
*/
const path = require('path');
const fractalCreateComponent = require('fractal-create-component');
const twigAdapter = require('@wondrousllc/fractal-twig-drupal-adapter');
// const twigDocsAdapter = require('@frctl/twig');
/*
* Require the Fractal module
*/
const fractal = (module.exports = require('@frctl/fractal').create());
const twig = twigAdapter({
handlePrefix: '@fractal/',
});
// Setup Twig
fractal.components.engine(twigAdapter);
fractal.components.set('ext', '.twig');
// fractal.docs.engine(twigDocsAdapter);
// Metadata
fractal.set('project.title', 'BC__BASE__NAME');
fractal.set('project.version', 'v1.0');
// Components/Docs Settings
fractal.components.set('path', path.join(__dirname, `${libPath}`, 'patterns'));
fractal.components.set('default.preview', '@preview');
fractal.docs.set('path', path.join(__dirname, `${libPath}`, 'docs'));
// Static Assets Path
fractal.web.set('static.path', path.join(__dirname, `${distPath}`));
// Build Directory
fractal.web.set('builder.dest', 'fractal-build');
// Custom Fractal Theme - Bluecadet a11y additions
const mandelbrot = require('@frctl/mandelbrot');
const a11yTheme = require('@bluecadet/cadetfrctl')(mandelbrot, {
favicon: '/images/fractal_favicon.png',
styles: ['default', '/css/fractal.css'],
});
fractal.web.theme(a11yTheme);
// Statues
fractal.components.set('statuses', {
proto: {
label: 'Prototype',
description: 'Do not implement.',
color: '#c0392b',
},
wip: {
label: 'WIP',
description: 'Work in progress. Implement with caution.',
color: '#e67e22',
},
ready: {
label: 'Ready',
description: 'Ready to implement.',
color: '#27ae60',
},
});
// init fractal-create-component. Can fractal cc new-component to generate components
fractalCreateComponent.init(fractal);