@@ -12,19 +12,20 @@ module.exports = () => ({
12
12
13
13
the returned object may have the following properties:
14
14
15
- | Option | Description |
16
- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
17
- | customPackageFields | Array of fields from the relevant package.json to display on the package home page. This augments the default set. |
18
- | docs | Object (or array of Object) describing the project docs. |
19
- | favicon | Absolute path to an .ico file to use as the site's favicon e.g. ` path.join(__dirname, 'favicon.ico') ` |
20
- | links | Optional array of Object with links to display on the homepage |
21
- | packages | Path or array of paths of packages to show. Glob patterns are allowed. e.g. ` path.join(__dirname, 'packages', '*') ` |
22
- | packagesDescription | Optional String to replace the default description for the packages section |
23
- | readMePath | Optional String path to an alternative specific mdx file to use as the "Get Started" page. |
24
- | showExamples | Optional Boolean (default true) to include/exclude examples |
25
- | showSubExamples | Optional Boolean to include/exclude subExamples within packages |
26
- | siteName | String Display name for the project as displayed in the website |
27
- | webpack | A function used to customise the website's webpack configuration. see [ Configuring webpack] ( ./configuring-webpack ) for more details |
15
+ | Option | Description |
16
+ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
17
+ | customPackageFields | Array of fields from the relevant package.json to display on the package home page. This augments the default set. |
18
+ | docs | Object (or array of Object) describing the project docs. |
19
+ | favicon | Absolute path to an .ico file to use as the site's favicon e.g. ` path.join(__dirname, 'favicon.ico') ` |
20
+ | links | Optional array of Object with links to display on the homepage |
21
+ | packages | Path or array of paths of packages to show. Glob patterns are allowed. e.g. ` path.join(__dirname, 'packages', '*') ` |
22
+ | packagesDescription | Optional String to replace the default description for the packages section |
23
+ | readMePath | Optional String path to an alternative specific mdx file to use as the "Get Started" page. |
24
+ | showExamples | Optional Boolean (default true) to include/exclude examples |
25
+ | showSubExamples | Optional Boolean to include/exclude subExamples within packages |
26
+ | siteName | String Display name for the project as displayed in the website |
27
+ | templates | Set up templates for particular kinds of pages in brisk |
28
+ | webpack | A function used to customise the website's webpack configuration. see [ Configuring webpack] ( ./configuring-webpack ) for more details |
28
29
29
30
### customPackageFields
30
31
@@ -38,6 +39,7 @@ e.g. `['author', 'dependencies']`
38
39
39
40
Type: optional ` object ` or ` object[] `
40
41
defaults to:
42
+
41
43
``` js
42
44
{
43
45
path: ' ./docs' ,
@@ -48,10 +50,10 @@ defaults to:
48
50
49
51
Object describing documentation sections
50
52
51
- * ` path ` : ` string ` of the absolute path to the documentation section's directory e.g. ` path.join(__dirname, 'docs') `
52
- * ` name ` : ` string ` to use for the documentation section e.g. ` 'Docs' `
53
- * ` description ` : Optional ` string ` description to refer to e.g. ` 'Documentation is contained within this section.' `
54
- * ` urlPath ` : Optional ` string ` specifying the URL subpath to use. e.g ` 'docs' ` . If not supplied, this will be inferred from the directory name.
53
+ - ` path ` : ` string ` of the absolute path to the documentation section's directory e.g. ` path.join(__dirname, 'docs') `
54
+ - ` name ` : ` string ` to use for the documentation section e.g. ` 'Docs' `
55
+ - ` description ` : Optional ` string ` description to refer to e.g. ` 'Documentation is contained within this section.' `
56
+ - ` urlPath ` : Optional ` string ` specifying the URL subpath to use. e.g ` 'docs' ` . If not supplied, this will be inferred from the directory name.
55
57
56
58
For a given path, if it does not exist, that section will not be generated.
57
59
@@ -71,24 +73,25 @@ Array of links to arbitrary places. These will be tiles at the end of all other
71
73
72
74
Each link has the following shape:
73
75
74
- * ` label ` : ` string ` to display on the home page tile
75
- * ` description ` : Optional ` string ` to display on the home page tile
76
- * ` href ` : ` string ` full URL (to external site) or internal link e.g. ` /packages `
76
+ - ` label ` : ` string ` to display on the home page tile
77
+ - ` description ` : Optional ` string ` to display on the home page tile
78
+ - ` href ` : ` string ` full URL (to external site) or internal link e.g. ` /packages `
77
79
78
80
e.g.
79
- ``` js
80
- [
81
- {
82
- label: ' Get accomplished today!' ,
83
- href: ' /docco/guides/how-to-be-accomplished'
84
- },
85
- {
86
- label: ' Get a job!' ,
87
- description: ' Browse the available Atlassian career opportunities and join the team.' ,
88
- href: ' https://www.atlassian.com/company/careers/all-jobs'
89
- },
90
- ]
91
81
82
+ ``` js
83
+ [
84
+ {
85
+ label: ' Get accomplished today!' ,
86
+ href: ' /docco/guides/how-to-be-accomplished' ,
87
+ },
88
+ {
89
+ label: ' Get a job!' ,
90
+ description:
91
+ ' Browse the available Atlassian career opportunities and join the team.' ,
92
+ href: ' https://www.atlassian.com/company/careers/all-jobs' ,
93
+ },
94
+ ];
92
95
```
93
96
94
97
### packages
@@ -143,7 +146,63 @@ e.g. `Fancy Docs`
143
146
144
147
Type: optional ` Function ` customizing webpack's configuration. Defaults to ` identity `
145
148
146
- See [ Configuring webpack] ( ./configuring-webpack ) for more details.
149
+ See [ Configuring webpack] ( ./configuring-webpack.md ) for more details.
150
+
151
+ ### templates
152
+
153
+ Type: optional ` object[] ` defaults to ` [] `
154
+
155
+ Allows you to specify a component to be rendered on a page. This feature is still experimental.
156
+
157
+ To add a template to a page, you can add an object to the array of the shape
158
+
159
+ ``` json
160
+ {
161
+ // the page you want to display this template component ont
162
+ "page" : string,
163
+ // the position you want to display the template component in
164
+ "position" : string,
165
+ // a path to the component you wish to render
166
+ "component" : string
167
+ }
168
+ ```
169
+
170
+ Current pages that support templates:
171
+
172
+ - ` package:home `
173
+
174
+ Positions for template are: ` above ` , ` below ` , and ` replace `
175
+
176
+ ` component ` accepts a string which is a path to a file we will load. We treat this file as a react component to load on the website.
177
+
178
+ We pass two props to this component: ` data ` and ` pageComponent ` . To get an idea of what is being passed, you could add the following component as a template.
179
+
180
+ ``` js
181
+ import React from ' react' ;
182
+
183
+ export default ({ data }) => console .log (data) || null ;
184
+ ```
185
+
186
+ You can also style the page contents using something such as:
187
+
188
+ ``` js
189
+ import React from ' react' ;
190
+
191
+ export default ({ pageComponent: Component }) => (
192
+ < div
193
+ style= {{
194
+ textAlign: ' center' ,
195
+ color: ' rebeccapurple' ,
196
+ backgroundColor: ' hotpink' ,
197
+ borderRadius: ' 16px' ,
198
+ padding: ' 8px' ,
199
+ marginTop: ' 16px' ,
200
+ }}
201
+ >
202
+ < Component / >
203
+ < / div>
204
+ );
205
+ ```
147
206
148
207
## Nested configuration
149
208
0 commit comments