-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
144 lines (134 loc) · 3.76 KB
/
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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
const package = require(`${process.env.PWD}/package.json`);
const fs = require('fs');
const path = require('path');
module.exports = {
/**
* The base URL is used by the static site to find static assets. For local
* development it is relative while for the production (GitHub Pages) site it
* it uses prepends the site root URL to all paths.
*
* @var {String}
*/
baseUrl: (process.env.NODE_ENV === 'production') ?
`${package.homepage}/` : 'http://localhost:8080/',
/**
* The following set of path strings define where directories are located for
* compiling entry points.
*
* @var {String}
*/
base: process.env.PWD,
src: 'src',
dist: 'dist',
packages: 'packages',
assets: 'assets',
entry: {
styles: 'scss/_styles.scss',
scripts: 'js/index.js'
},
output: {
styles: 'css/styles.css',
scripts: 'js/default.js'
},
/**
* The following load paths are used by the Dart Sass library to find Sass modules
*
* @type {Array}
*/
loadPaths: [
'src',
'packages',
'node_modules',
'node_modules/@uswds',
'node_modules/@uswds/uswds/packages'
],
/**
* 11ty (Eleventy) static site documentation configuration. Not all
* settings are relevant to 11ty but to packages used in eleventy.config.js
*/
/**
* 11ty (Eleventy) configuration.
*
* @source https://www.11ty.dev/docs
*/
eleventy: {
dir: {
input: 'src/views',
output: 'dist',
layouts: '_layouts',
includes: '_partials'
},
watchTargets: [
'./packages/**/*.{html.erb,th.html}',
'./src/views/**/*.{twig,md}'
],
serverOptions: {
watch: './dist/**/*.{css,js,svg,png,jpg,jpeg,gif}'
}
},
/**
* Settings for the structural rendering of code. These settings are
* passed to the js-beautify plugin directly.
*
* @source https://github.com/beautify-web/js-beautify#options
*/
beautify: {
indent_size: 2,
indent_char: ' ',
preserve_newlines: false,
indent_inner_html: false,
inline: [],
wrap_line_length: 0
},
/**
* Syntax highlighters used for code. Languages are imported from
* the Highlight.js library.
*
* @source https://highlightjs.org
*/
hightlightJs: [
'bash',
'css',
'erb',
'java',
'javascript',
'json',
'markdown',
'plaintext',
'ruby',
'scss',
'twig',
'typescript',
'xml',
],
/**
* Configuration for the markdownIt library. Used for 11ty markdown config
* and the {% md %} markdown shortcode.
*
* @source https://github.com/markdown-it/markdown-it
*/
markdownIt: {
html: true,
breaks: false,
linkify: true
},
/**
* Options for the ThymeleafJS library.
*
* @source https://github.com/ultraq/thymeleafjs#new-templateengineoptions
*/
thymeleaf: {
templateResolver: (templateName) => {
return fs.readFileSync(path.join(__dirname, `${templateName}.html`));
}
},
/**
* Common dictionary strings for the documentation
*/
dictionary: {
package: 'Packages are collections of functionality that make up a component. Typically, they include stylesheets, templates, and scripts.',
tokens: 'Tokens define the name of basic system elements such as color, typography, or spacing. The values of tokens are relative to how the system defines them. This enables teams to alter the visual appearance of components yet remain within the system boundaries.',
modifier: 'A modifier is a class name that applies a variant, type, or extended style customization to modify the component\'s visual appearance.',
context: 'Context is the information necessary to configure and render a component template to HTML. It may include plain text strings, HTML, class names, IDs or other HTML attribute values.'
}
};