This repository has been archived by the owner on Apr 8, 2021. It is now read-only.
forked from italia/design-web-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fractal.js
102 lines (83 loc) · 2.3 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
94
95
96
97
98
99
100
101
102
const fractal = module.exports = require('@frctl/fractal').create()
fractal.set('project.title', 'Web Toolkit Styleguide')
fractal.components.set('path', __dirname + '/src')
fractal.docs.set('path', __dirname + '/docs')
fractal.web.set('static.path', __dirname + '/build')
// prefix all resources url with '/build'
if (process.env.DEPLOY === 'true') {
fractal.web.set('static.mount', '/ita-web-toolkit/build')
} else {
fractal.web.set('static.mount', '/build')
}
fractal.web.set('builder.dest', __dirname + '/styleguide')
fractal.components.set('default.preview', '@preview')
fractal.components.set('default.status', 'wip')
const faker = require('faker')
const _ = require('lodash')
const nunj = require('@frctl/nunjucks')({
paths: ['src', 'docs'],
globals: {
__WORD__: _.range(10).map(function() {
return faker.lorem.word()
}),
__WORDS__: _.range(10).map(function() {
return faker.lorem.words()
}),
__TEXTS__: _.range(10).map(function() {
return faker.lorem.paragraph()
}),
__SHORT_TEXTS__: _.range(10).map(function() {
return faker.lorem.sentence()
}),
__LONG_TEXTS__: _.range(10).map(function() {
return faker.lorem.paragraphs()
}),
__IMAGES__: _.range(10).map(function() {
return faker.image.image()
})
}
})
fractal.components.engine(nunj)
fractal.docs.engine(nunj)
fractal.components.set('ext', '.tmpl')
fractal.docs.set('ext', '.md')
/*
* Specify default theme
*/
const mandelbrot = require('@frctl/mandelbrot')
/*
* Specify custom theme
*/
const myCustomisedTheme = mandelbrot({
skin: 'blue',
'nav': [
'docs',
'components'
],
// ["html", "view", "context", "resources", "info", "notes"]
'panels': [
'html',
'resources',
'info',
'notes'
],
'lang': 'it',
'styles': [
'default',
'/ita-web-toolkit/theme/styleguide.css',
'/build/build-styleguide.css'
],
'scripts': [
'default',
'/build/styleguide.min.js',
'/ita-web-toolkit/theme/styleguide-menu-override.js'
]
})
myCustomisedTheme.addStatic(__dirname + '/theme', '/ita-web-toolkit/theme')
/*
* Specify theme-overrides folder
*/
myCustomisedTheme.addLoadPath(__dirname + '/views')
fractal.components.set('title', 'Componenti')
fractal.docs.set('title', 'Documentazione')
fractal.web.theme(myCustomisedTheme)