-
Notifications
You must be signed in to change notification settings - Fork 21
/
config.js
267 lines (257 loc) · 8.46 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
// config for all the things
// docsSections defines the docs tree. Items are either a path to a markdown file,
// or a group object with title, path, description, items
// top-level group objects also have colorClass
const docsSections = [
{
title: 'Tutorials',
path: '/docs/tutorials',
description: 'Welcome! These tutorials are aimed at beginners and will break things down so you can get started quickly.',
colorClass: 'text-qriorange-600',
items: []
},
{
title: 'Guides',
path: '/docs/guides',
description: 'These step-by-step guides will help you perform specific tasks. Refer to them when you need to do one thing well.',
colorClass: 'text-qripink-600',
items: [
{
title: 'Qri Transforms',
path: '/docs/guides/transforms',
description: 'These guides will cover various techniques for using Qri transforms to keep your datasets fresh',
items: [
'/docs/guides/transforms/scrape-data-from-a-website'
]
},
{
title: 'Qri CLI',
path: '/docs/guides/qri-cli',
description: 'These guides will cover tasks you can perform with a local Qri repository and our Command Line Interface',
items: [
'/docs/guides/qri-cli/install-qri-cli',
'/docs/guides/qri-cli/setup-your-local-qri-repository',
'/docs/guides/qri-cli/create-a-dataset-from-a-csv',
'/docs/guides/qri-cli/push-a-dataset-to-qri-cloud'
]
}
]
},
{
title: 'Concepts',
path: '/docs/concepts',
description: 'These docs will help explain Qri\'s core concepts and underlying technology',
colorClass: 'text-qrigreen-600',
items: [
{
title: 'Understanding Qri',
path: '/docs/concepts/understanding-qri',
description: 'This section provides detailed explanations of core Qri concepts',
items: [
'/docs/concepts/understanding-qri/what-is-qri',
'/docs/concepts/understanding-qri/how-qri-defines-a-dataset',
'/docs/concepts/understanding-qri/how-qri-version-control-works',
'/docs/concepts/understanding-qri/how-qri-data-transforms-and-automation-work'
]
},
{
title: 'Under the Hood',
path: '/docs/concepts/under-the-hood',
description: 'Dive deeper into underlying Qri concepts',
items: [
'/docs/concepts/under-the-hood/content-addressing',
'/docs/concepts/under-the-hood/how-qri-uses-ipfs',
'/docs/concepts/under-the-hood/why-starlark'
]
}
]
},
{
title: 'Reference',
path: '/docs/reference',
description: 'These technical reference docs will help you use Qri\'s APIs and write custom data transform scripts',
colorClass: 'text-qrinavy-300',
items: [
{
title: 'Starlark Language',
path: '/docs/reference/starlark-language',
description: 'Starlark is an untyped dynamic language with high-level data types, first-class functions with lexical scope, and automatic memory management or garbage collection.',
items: [
'/docs/reference/starlark-language/overview',
'/docs/reference/starlark-language/lexical-elements',
'/docs/reference/starlark-language/data-types',
'/docs/reference/starlark-language/value-concepts',
'/docs/reference/starlark-language/expressions',
'/docs/reference/starlark-language/statements',
'/docs/reference/starlark-language/built-in-constants-and-functions',
{
title: 'Built-in Methods',
path: '/docs/reference/starlark-language/built-in-methods',
description: 'Built-in methods for the Starlark data types',
items: [
'/docs/reference/starlark-language/built-in-methods/dict',
'/docs/reference/starlark-language/built-in-methods/list',
'/docs/reference/starlark-language/built-in-methods/set',
'/docs/reference/starlark-language/built-in-methods/string'
]
}
]
},
{
title: 'Qri HTTP API',
path: '/docs/reference/qri-http-api',
description: 'You can interacto with qri.cloud or with your local qri node via HTTP requests',
items: [
'/docs/reference/qri-http-api/json-api-spec'
]
},
{
title: 'Starlark Packages',
path: '/docs/reference/starlark-packages',
description: 'These packages extend Starlark\'s core functionality, and can be easily imported and used in your Qri transform scripts',
items: [
'/docs/reference/starlark-packages/overview',
'/docs/reference/starlark-packages/bsoup',
'/docs/reference/starlark-packages/dataframe',
{
title: 'compress',
path: '/docs/reference/starlark-packages/compress',
description: 'A set of Starlark packages for various types of compression/decompression',
items: [
'/docs/reference/starlark-packages/compress/gzip'
]
},
{
title: 'encoding',
path: '/docs/reference/starlark-packages/encoding',
description: 'A set of Starlark packages for various types of encoding/decoding',
items: [
'/docs/reference/starlark-packages/encoding/base64',
'/docs/reference/starlark-packages/encoding/csv',
'/docs/reference/starlark-packages/encoding/json',
'/docs/reference/starlark-packages/encoding/yaml'
]
},
'/docs/reference/starlark-packages/geo',
'/docs/reference/starlark-packages/hash',
'/docs/reference/starlark-packages/html',
'/docs/reference/starlark-packages/http',
'/docs/reference/starlark-packages/math',
'/docs/reference/starlark-packages/re',
'/docs/reference/starlark-packages/time',
'/docs/reference/starlark-packages/xlsx',
'/docs/reference/starlark-packages/zipfile'
]
}
]
},
{
title: 'Transform Snippets',
path: '/docs/transform-snippets',
colorClass: 'text-qrinavy-700'
}
]
const processSection = ({ title, path, items }) => {
if (title && path) {
flattenedGroups.push({
title,
path
})
}
if (items) {
items.forEach(processSection)
}
}
// flatten groups in docsSections to allow for easier lookups for breacrumbs, etc
const flattenedGroups = []
docsSections.forEach(processSection)
// takes crumbs array from gatsby-plugin-breadcrumb
// replaces crumbLabel with descriptions from docsSections
const processCrumbs = (crumbs) => {
const newCrumbs = crumbs.map((crumb) => {
let newCrumbLabel = crumb.crumbLabel
// capitalize docs
if (crumb.crumbLabel === 'docs') {
newCrumbLabel = 'Docs'
}
// for all others, lookup path
const match = flattenedGroups.find(d => d.path === crumb.pathname)
if (match) { newCrumbLabel = match.title }
return {
...crumb,
crumbLabel: newCrumbLabel
}
})
return newCrumbs
}
const config = {
gatsby: {
pathPrefix: '/',
siteUrl: 'https://qri.io',
gaTrackingId: null
},
header: {
mainLinks: [
{
text: 'About',
link: '/about'
},
{
text: 'Datasets',
link: 'https://qri.cloud'
},
{
text: 'Documentation',
link: '/docs'
},
{
text: 'Blog',
link: 'https://medium.com/qri-io'
},
{
text: 'Jobs',
link: 'https://jobs.lever.co/Qri'
},
{
text: 'FAQ',
link: '/docs/faq'
}
],
docsLinks: [
...docsSections.map((d) => ({
text: d.title,
link: d.path,
colorClass: d.colorClass
})),
{
text: 'FAQ',
link: '/docs/faq'
}
]
},
sidebar: {
// modified from original config, this is now only for ordering top-level groups
forcedNavOrder: [
'getting-started',
'dataset-components',
'working-with-datasets',
'integrating-qri',
'reference'
],
links: [
// { "text": "", "link": ""},
],
frontline: false,
ignoreIndex: true
},
siteMetadata: {
title: 'Qri.io',
description: 'Qri Website and Documentation',
ogImage: null,
docsLocation: 'https://github.com/qri-io/website/blob/master/content',
favicon: 'https://graphql-engine-cdn.hasura.io/img/hasura_icon_black.svg'
},
docsSections,
processCrumbs
}
module.exports = config