-
Notifications
You must be signed in to change notification settings - Fork 5
/
gridsome.config.js
63 lines (61 loc) · 1.95 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
// This is where project configuration and plugin options are located.
// Learn more: https://gridsome.org/docs/config
// Changes here require a server restart.
// To restart press CTRL + C in terminal and run `gridsome develop`
module.exports = {
siteName: 'Xebia Essentials',
siteDescription: 'The Xebia Essentials is a deck of flash cards about software craftsmanship.',
siteUrl: 'https://essentials.xebia.com',
icon: {
favicon: './src/touch-icon.png',
touchicon: './src/touch-icon.png',
},
plugins: [
{
use: 'gridsome-plugin-tailwindcss',
options: {
shouldPurge: process.env.NODE_ENV === 'production',
purgeConfig: {
content: ['./{src,cards}/**/*.vue', './{src,cards}/**/*.js', './{src,cards}/**/*.html', './cards/**/*.md'],
keyframes: false,
whitelist: ['body', 'html', 'img', 'a', 'g-image', 'g-image--lazy', 'g-image--loaded'],
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
},
},
},
{
use: '@gridsome/source-filesystem',
options: {
path: '**/*.md',
baseDir: './cards',
typeName: 'Card',
refs: {
category: {
typeName: 'Category',
create: true,
},
},
remark: {
grayMatter: {
excerpt: (file, options) => {
// Strip out the middle blocks, because they are for physical cards (back and front)
const [content, ...meta] = file.content.split('---\n').reverse();
file.excerpt = meta[meta.length - 1];
file.summary = meta.length > 1 ? meta[meta.length - 2] : ''; // It looks like this is not working
file.content = content;
},
},
},
},
},
{
use: '@gridsome/plugin-google-analytics',
options: {
id: 'UA-45163453-1',
},
},
],
templates: {
Category: [{ path: '/categories/:id' }],
},
};