This repository has been archived by the owner on Dec 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfractal.js
59 lines (45 loc) · 1.42 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
'use strict';
/*
* Require the path module
*/
const path = require('path');
/*
* Require the Fractal module
*/
const fractal = module.exports = require('@frctl/fractal').create();
/*
* Give your project a title.
*/
fractal.set('project.title', 'Example Project');
/*
* Tell Fractal where to look for components.
*/
fractal.components.set('path', path.join(__dirname, 'src', 'components'));
fractal.components.set('default.preview', '@preview');
/*
* Tell Fractal where to look for documentation pages.
*/
fractal.docs.set('path', path.join(__dirname, 'src', 'docs'));
/*
* Tell the Fractal web preview plugin where to look for static assets.
*/
fractal.web.set('static.path', path.join(__dirname, 'public'));
const mandelbrot = require('@frctl/mandelbrot');
const repeatHelper = require('handlebars-helper-repeat');
fractal.web.set('static.path', __dirname + '/public');
const hbs = require('@frctl/handlebars')({
helpers: {
json: (context) => JSON.stringify(context),
repeat: repeatHelper
}
});
fractal.components.engine(hbs);
// create a new instance with custom config options
const myCustomisedTheme = mandelbrot({
skin: "black",
// any other theme configuration values here
panels: ['html', 'notes', 'context', 'info'],
lang: 'de'
});
fractal.web.theme(myCustomisedTheme); // tell Fractal to use the configured theme by default
fractal.web.set('builder.dest', __dirname + '/build');