File tree 7 files changed +40
-60
lines changed
7 files changed +40
-60
lines changed Original file line number Diff line number Diff line change @@ -91,38 +91,5 @@ module.exports = {
91
91
}
92
92
}
93
93
}
94
- ] ,
95
- // Create routes from GraphQL nodes
96
- nodeRoutes : {
97
- WordPressPost : '/:year/:month/:slug' ,
98
- WordPressTag : '/tag/:slug' ,
99
- CustomType : {
100
- route : '/other/:custom/:type' ,
101
- component : './src/templates/MyTemplate.vue' , // default templates/typeName.vue
102
- nextFieldName : 'nextPost' ,
103
- prevFieldName : 'prevPost' ,
104
- sortBy : 'date'
105
- } ,
106
- Author : [
107
- {
108
- route : '/author/:name' ,
109
- component : './src/templates/Author.vue'
110
- } ,
111
- {
112
- route : '/author/:name/starters' ,
113
- component : './src/templates/AuthorStarters.vue'
114
- }
115
- ]
116
- } ,
117
- // Create dynamic routes
118
- clientRoutes : [
119
- {
120
- path : '/foo/' ,
121
- component : './src/templates/MyTemplate.vue' ,
122
- } ,
123
- {
124
- path : '/bar/:id' ,
125
- component : './src/templates/MyTemplate.vue' ,
126
- }
127
94
]
128
95
}
Original file line number Diff line number Diff line change @@ -54,14 +54,13 @@ module.exports = function (api) {
54
54
} )
55
55
56
56
// Connect author field to Contributors & Platforms
57
- starters . addReference ( 'author' , 'Contributor' )
58
- starters . addReference ( 'platforms' , 'Platform' )
57
+ starters . addReference ( 'author' , 'Contributor' )
58
+ starters . addReference ( 'platforms' , 'Platform' )
59
59
60
- startersJson . forEach ( ( { id , name : title , ... fields } ) => {
60
+ startersJson . forEach ( ( starter , index ) => {
61
61
starters . addNode ( {
62
- id,
63
- title,
64
- fields,
62
+ ...starter ,
63
+ index,
65
64
internal : {
66
65
origin : startersPath
67
66
}
@@ -78,11 +77,10 @@ module.exports = function (api) {
78
77
} )
79
78
80
79
// Connect author field to Contributors
81
- platformsJson . forEach ( ( { id , name : title , ... fields } ) => {
80
+ platformsJson . forEach ( ( platform , index ) => {
82
81
platforms . addNode ( {
83
- id,
84
- title,
85
- fields,
82
+ ...platform ,
83
+ index,
86
84
internal : {
87
85
origin : platformsPath
88
86
}
Original file line number Diff line number Diff line change @@ -83,4 +83,4 @@ export default {
83
83
}
84
84
}
85
85
</style >
86
- </style >
86
+ </style >
Original file line number Diff line number Diff line change @@ -30,11 +30,19 @@ export default {
30
30
31
31
<page-query >
32
32
query Starters {
33
- defaultStarters: allStarter (order: ASC, perPage: 3) {
33
+ defaultStarters: allStarter (
34
+ sort: [{ by: "index", order: ASC }]
35
+ filter: {
36
+ featured: {
37
+ eq: true
38
+ }
39
+ }
40
+ ) {
34
41
edges {
35
42
node {
36
43
id
37
44
title
45
+ path
38
46
description
39
47
preview
40
48
repo
@@ -46,18 +54,26 @@ query Starters {
46
54
title
47
55
path
48
56
}
49
- path
50
57
}
51
58
}
52
59
},
53
- starters: allStarter (order: ASC, skip: 3) {
60
+ starters: allStarter (
61
+ sortBy: "index"
62
+ filter: {
63
+ featured: {
64
+ ne: true
65
+ }
66
+ }
67
+ ) {
54
68
edges {
55
69
node {
56
70
id
57
71
title
58
72
description
59
73
preview
60
74
repo
75
+ path
76
+ screenshot (width: 840, height:840)
61
77
platforms {
62
78
title
63
79
logo
@@ -66,8 +82,6 @@ query Starters {
66
82
title
67
83
path
68
84
}
69
- path
70
- screenshot (width: 840, height:840)
71
85
}
72
86
}
73
87
}
Original file line number Diff line number Diff line change 26
26
query Platform($id: String!) {
27
27
platform(id: $id) {
28
28
title
29
- belongsTo {
29
+ belongsTo(sortBy: "index") {
30
30
edges {
31
31
node {
32
32
... on Starter {
@@ -35,6 +35,8 @@ query Platform($id: String!) {
35
35
description
36
36
preview
37
37
repo
38
+ path
39
+ screenshot (width: 840, height: 840)
38
40
platforms {
39
41
title
40
42
logo
@@ -43,8 +45,6 @@ query Platform($id: String!) {
43
45
title
44
46
path
45
47
}
46
- path
47
- screenshot (width: 840, height: 840)
48
48
}
49
49
}
50
50
}
Original file line number Diff line number Diff line change @@ -161,21 +161,21 @@ export default {
161
161
</script >
162
162
163
163
<page-query >
164
- query Starters ($id: String!) {
164
+ query Starters($id: String!) {
165
165
starter(id: $id) {
166
166
title
167
167
repo
168
+ path
169
+ preview
170
+ screenshot(width: 1680, quality: 80)
168
171
platforms {
169
172
title
170
- logo (width: 30, height: 30)
173
+ logo(width: 30, height: 30)
171
174
}
172
175
author {
173
176
title
174
177
path
175
178
}
176
- path
177
- preview
178
- screenshot (width: 1680, quality: 80)
179
179
}
180
180
}
181
181
</page-query >
Original file line number Diff line number Diff line change 1
1
- title : Default starter
2
2
repo : gridsome/gridsome-starter-default
3
3
author : gridsome
4
- tags : Default
4
+ featured : true
5
5
6
6
- title : Default WordPress starter
7
7
repo : gridsome/gridsome-starter-wordpress
8
8
author : gridsome
9
9
platforms : wordpress
10
- tags : Default
10
+ featured : true
11
11
12
12
- title : Default Contentful starter
13
13
repo : gridsome/gridsome-starter-contentful
14
14
author : gridsome
15
15
tags : markdown, tailwind
16
16
platforms : contentful
17
+ featured : true
17
18
18
19
- title : Gridsome Blog Starter
19
20
description : Official Markdown Blog Starter
20
21
screenshot : ./screenshots/gridsome-starter-blog.png
21
22
repo : gridsome/gridsome-starter-blog
22
23
preview : https://gridsome-starter-blog.netlify.com/
23
24
author : gridsome
24
- tags : Blog, Dark Mode
25
+ tags : blog, dark mode
25
26
platforms : markdown
26
27
27
28
- title : Bleda
You can’t perform that action at this time.
0 commit comments