-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgridsome.config.js
126 lines (123 loc) · 4.3 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
const tailwind = require('tailwindcss');
const postcssNested = require('postcss-nested');
const slugify = require('@sindresorhus/slugify');
const postcssPlugins = [
postcssNested,
tailwind('./tailwind.config.js'),
];
module.exports = {
siteName: 'FaireDesJeux.fr',
siteUrl: 'https://fairedesjeux.fr',
siteDescription: 'FaireDesJeux.fr est un site d\'apprentissage qui vous donne accès à des tutoriels gratuits pour créer vos jeux vidéo. Suivez les cours à l\'écrit ou en vidéo !',
titleTemplate: '%s · FaireDesJeux.fr',
icon: {
favicon: './static/favicon/favicon.png',
touchicon: './static/favicon/touchicon.png',
},
plugins: [
{
use: '@gridsome/source-filesystem',
options: {
typeName: 'Section',
baseDir: './content/courses/',
path: ['**/*.md', '!**/course.md', '!**/chapter.md'],
},
},
{
use: '@gridsome/source-filesystem',
options: {
typeName: 'Chapter',
baseDir: './content/courses',
path: '**/chapter.md',
},
},
{
use: '@gridsome/source-filesystem',
options: {
typeName: 'Course',
baseDir: './content/courses/',
path: '**/course.md',
},
},
],
templates: {
Section: [{
path: (node) => {
/*
NOTE : Since we can't get the chapter name from the node itself due to it being added later
(in onCreateNode) we can't get it here (why) so we have to get it ourselves - erika, 2020-04-20
*/
const slashPosition = node.fileInfo.directory.indexOf('/');
const idToRemove = node.fileInfo.directory.substr(slashPosition + 1, 3);
return `/${node.fileInfo.directory.replace(idToRemove, '')}/${node.slug !== undefined ? slugify(node.slug) : slugify(node.fileInfo.name.substr(3))}`;
},
component: './src/templates/Sections.vue',
}],
Course: [{
path: '/:fileInfo__directory',
component: './src/templates/Courses.vue',
}],
},
css: {
loaderOptions: {
postcss: {
plugins: postcssPlugins,
},
},
},
transformers: {
remark: {
imageQuality: 100,
config: {
footnotes: true,
},
plugins: [
'@gridsome/remark-prismjs',
'gridsome-plugin-remark-youtube',
'remark-shortcodes',
'gridsome-remark-video-shortcode',
/*
NOTE : Used for speech bubbles with our mascots - Nev, 14/08/2020
*/
['gridsome-plugin-remark-container', {
customTypes: {
astride: {
defaultTitle: 'Astride',
},
marvin: {
defaultTitle: 'Marvin',
},
remi: {
defaultTitle: 'Rémi',
},
winkastride: {
defaultTitle: 'Astride',
},
sighastride: {
defaultTitle: 'Astride',
},
oofmarvin: {
defaultTitle: 'Marvin',
},
hypemarvin: {
defaultTitle: 'Marvin',
},
profremi: {
defaultTitle: 'Rémi',
},
notlikethisremi: {
defaultTitle: 'Rémi',
},
},
useDefaultTypes: false,
icons: 'none',
classMaster: 'bubble',
}],
],
},
},
chainWebpack: (config) => {
config.resolve.alias.set('@avatars', '@/assets/avatar');
config.resolve.alias.set('@medals', '@/assets/medals');
},
};