forked from baruchiro/BcsStudent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgridsome.server.js
More file actions
60 lines (51 loc) · 1.74 KB
/
gridsome.server.js
File metadata and controls
60 lines (51 loc) · 1.74 KB
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
// 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 requires a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`
const privateSocialLinks = [
'mailto:baruchiro@gmail.com',
'https://github.com/baruchiro',
'https://www.linkedin.com/in/baruch-rothkoff/',
'https://twitter.com/baruchiro',
'https://stackoverflow.com/users/839513/baruchiro'
]
const blogSocialLinks = [
'https://www.facebook.com/BcsStudentBlog',
'https://twitter.com/BcsStudent1',
'https://github.com/baruchiro/BcsStudent',
'/feed.xml'
]
const tagDescriptions = {
Idea: `רעיונות שעולים לי בראש, אבל אין לי זמן לפתח אותם.
אני חושב שבמקום לפתח עוד מחשבון כשלומדים שפת תכנות, אפשר לקחת כפרויקט את אחד מהרעיונות האלה.
אני אעזור בשמחה למי שמעוניין לבצע את אחד הרעיונות.`
}
module.exports = function (api) {
api.loadSource(({ addCollection, addSchemaResolvers }) => {
// Use the Data store API here: https://gridsome.org/docs/data-store-api/
const socialCollection = addCollection('Social')
privateSocialLinks.forEach((link) => {
socialCollection.addNode({
link,
blog: false
})
})
blogSocialLinks.forEach((link) => {
socialCollection.addNode({
link,
blog: true
})
})
addSchemaResolvers({
Tag: {
description: {
type: 'String',
resolve: ({ id }) => {
return tagDescriptions[id]
}
}
}
})
})
}