forked from unisonweb/unisonweb-org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gridsome.config.js
157 lines (139 loc) · 3.25 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
const CONFIG = {
algolia: require('./config/algolia'),
postcss: require('./config/postcss'),
remarkPlugins: require('./config/remarkPlugins'),
scss: require('./config/scss'),
svgo: require('./config/svgo'),
}
module.exports = {
siteName: 'Unison Computing',
siteUrl: 'https://www.unisonweb.org',
titleTemplate: '%s',
plugins: [
{ // supplemental pages
use: '@gridsome/source-filesystem',
options: {
typeName: 'SupplementalPage',
baseDir: './src/data/supplemental-pages',
path: '**/*.md',
remark: {
autolinkHeadings: {
behavior: 'append',
content: {
type: 'text',
value: '#'
}
}
}
}
},
{ // blog posts
use: '@gridsome/source-filesystem',
options: {
typeName: 'BlogPost',
baseDir: './src/data/blog/posts',
path: '**/index.md',
remark: {
autolinkHeadings: {
behavior: 'append',
content: {
type: 'text',
value: '#'
}
}
},
refs: {
authors: 'Author',
categories: 'Category',
}
}
},
{ // author references
use: '@gridsome/source-filesystem',
options: {
typeName: 'Author',
baseDir: './src/data/blog/authors',
path: '*.md',
}
},
{ // category indexes
use: '@gridsome/source-filesystem',
options: {
typeName: 'Category',
baseDir: './src/data/blog/categories',
path: '*.md',
}
},
{ // doc pages
use: '@gridsome/source-filesystem',
options: {
typeName: 'DocPage',
index: ['README'],
baseDir: './src/data/docs',
pathPrefix: '/docs',
path: '**/*.md',
remark: {
autolinkHeadings: {
behavior: 'append',
content: {
type: 'text',
value: '#'
}
}
}
}
},
{ // sitemap.xml
use: '@gridsome/plugin-sitemap',
options: {
cacheTime: 600000, // default
}
},
{ // algolia integration
use: 'gridsome-plugin-algolia',
options: {
appId: process.env.ALGOLIA_APP_ID,
apiKey: process.env.ALGOLIA_ADMIN_KEY,
collections: CONFIG.algolia.collections,
chunkSize: 10000, // default: 1000
enablePartialUpdates: true, // default: false
},
}
],
templates: {
BlogPost: '/:year/:month/:day/:slug',
Author: '/author/:id',
Category: '/category/:id',
},
transformers: {
remark: {
squeezeParagraphs: true,
externalLinks: true,
externalLinksTarget: '_blank',
plugins: CONFIG.remarkPlugins,
}
},
css: {
loaderOptions: {
scss: CONFIG.scss,
postcss: CONFIG.postcss,
},
},
chainWebpack: config => {
// config.mode('development')
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule
.use('babel-loader')
.loader('babel-loader')
.end()
.use('vue-svg-loader')
.loader('vue-svg-loader')
.options({
svgo: {
plugins: CONFIG.svgo
}
})
.end()
},
}