-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgridsome.config.js
200 lines (197 loc) · 5.01 KB
/
gridsome.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
// This is where project configuration and plugin options are located.
// Learn more: https://gridsome.org/docs/config
// Changes here requires a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`
const tailwind = require('tailwindcss')
const autoprefixer = require('autoprefixer')
const postcss = require('postcss-import')
const token = process.env.github_kb_orcafit
console.log(token)
const collections = [
{
query: `{
allPost {
edges {
node {
id
title
date (format: "D. MMMM YYYY")
}
}
}
}
`,
transformer: ({ data }) => data.allPost.edges.map(({ node }) => node),
indexName: 'kb.OrcaFit', // Algolia index name
itemFormatter: (item) => {
return {
objectID: item.id,
title: item.title,
modified: String(item.date)
}
}, // optional
matchFields: ['slug', 'modified'], // Array<String> required with PartialUpdates
},
]
module.exports = {
siteName: 'Orca Fit Exercise Knowledge Base',
siteDescription: 'A resource for building rehab as well as strength & conditioning programs',
templates: {
Post: '/:title',
Tag: '/tag/:id',
Bodypart: '/bodypart/:id',
Program: [{
path: '/programs/:title',
component: './src/templates/Program.vue'
}],
Workout: [{
path: '/workouts/:title',
component: './src/templates/Workout.vue'
}],
// Program: [{
// path: '/programs/:id',
// component: './src/templates/Program.vue'
// },{
// path: '/content/programs/:title',
// component: './src/templates/Program.vue'
// }]
},
css: {
loaderOptions: {
postcss: {
plugins: [
tailwind(),
autoprefixer()
]
}
}
},
plugins: [
{
resolve: `gridsome-source-github-api`,
options: {
token: "294b20cf42189f9184acc2f02c1eb14c59809ded",
variables: {
},
graphQLQuery: `
query {
search(type:REPOSITORY, first:1, query:"markgstacey/kb.orcafit") {
edges {
node {
... on Repository {
name,
object(expression:"master:content/posts") {
... on Tree {
entries {
name,
type
}
}
}
}
}
}
}
}
`
},
// Create posts from markdown files
use: '@gridsome/source-filesystem',
options: {
typeName: 'Post',
path: 'content/posts/*.md',
refs: {
// Creates a GraphQL collection from 'tags' in front-matter and adds a reference.
tags: {
typeName: 'Tag',
create: true
},
bodyparts: {
typeName: 'Bodypart',
create: true
},
equipment: {
typeName: 'Equipment',
create: true
}
}
}
},
{
// Create posts from markdown files
use: '@gridsome/source-filesystem',
options: {
typeName: 'Program',
path: 'content/programs/*.md',
refs: {
// Creates a GraphQL collection from 'tags' in front-matter and adds a reference.
tags: {
typeName: 'Tag',
create: true
}
}
}
},
{
// Create workouts from markdown files
use: '@gridsome/source-filesystem',
options: {
typeName: 'Workout',
path: 'content/workouts/*.md',
refs: {
// Creates a GraphQL collection from 'tags' in front-matter and adds a reference.
tags: {
typeName: 'Tag',
create: true
}
}
}
},
{
use: 'gridsome-plugin-flexsearch',
options: {
searchFields: ['title', 'tags'],
collections: [
{
typeName: 'Post',
indexName: 'Post',
fields: ['id','title', 'handle', 'description', 'path']
}
]
}
}
// ,
// {
// use: `gridsome-plugin-algolia`,
// options: {
// appId: 'X8QGZL1SEH',
// apiKey: 'da245f71d8e5c4b1b9beb99e113b44bf',
// collections,
// chunkSize: 10000, // default: 1000
// enablePartialUpdates: false, // default: false
// },
// }
// ,
// {
// use: `gridsome-plugin-algolia`,
// options: {
// appId: process.env.ALGOLIA_APP_ID,
// apiKey: process.env.ALGOLIA_ADMIN_KEY,
// collections,
// chunkSize: 10000, // default: 1000
// enablePartialUpdates: true, // default: false
// },
// }
],
transformers: {
// Add markdown support to all file-system sources
remark: {
externalLinksTarget: '_blank',
externalLinksRel: ['nofollow', 'noopener', 'noreferrer'],
anchorClassName: 'icon icon-link',
plugins: [
'@gridsome/remark-prismjs'
]
}
}
}