forked from stakeordie/SecretWebsiteV2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gridsome.server.js
69 lines (63 loc) · 1.84 KB
/
gridsome.server.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
// Server API makes it possible to hook into various parts of Gridsome
// on server-side and add custom data to the GraphQL data layer.
// Learn more: https://gridsome.org/docs/server-api/
// Changes here require a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`
module.exports = function(api) {
api.loadSource((store) => {
// Use the Data Store API here: https://gridsome.org/docs/data-store-api
store.addSchemaTypes(`
type StrapiContributors_Types {
id: Int
name: String
}
type StrapiDApps_Types {
id: Int
name: String
}
type StrapiToolsAndWallets_Types {
id: Int
name: String
}
type StrapiInternationalCommunities_Types {
id: Int
name: String
}
type StrapiExchanges_Types {
id: Int
name: String
}
type StrapiContributors implements Node @infer {
sort: Int
types: [StrapiContributors_Types]
}
type StrapiDApps implements Node @infer {
sort: Int
types: [StrapiDApps_Types]
}
type StrapiToolsAndWallets implements Node @infer {
sort: Int
types: [StrapiToolsAndWallets_Types]
}
type StrapiExchanges implements Node @infer {
sort: Int
types: [StrapiExchanges_Types]
}
type StrapiInternationalCommunities implements Node @infer {
sort: Int
types: [StrapiInternationalCommunities_Types]
}
`)
const data = require('./data/settings.json');
const Menu = store.addCollection({typeName: 'Menu'})
for(const item of data.sidebar){
Menu.addNode({
section: item.section,
topics: item.topics
})
}
})
api.createPages(({ createPage }) => {
// Use the Pages API here: https://gridsome.org/docs/pages-api/
})
}