-
Notifications
You must be signed in to change notification settings - Fork 0
/
gridsome.config.js
158 lines (152 loc) · 3.96 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
// 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 paramCase = require('param-case');
module.exports = {
siteName: 'Dev | Blog',
siteDescription:
'software development, operations, tooling, and musings on technology by Eric McCormick',
siteUrl: 'https://edm00se.io',
icon: './src/favicon.png',
titleTemplate: '%s',
templates: {
Post: [{
path: (node) => {
return node.permalink ? node.permalink : `/${paramCase(node.title)}`;
}
}],
Tag: '/tag/:id',
Category: '/categories/:id',
Series: '/series/:id'
},
plugins: [
{
// 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
},
category: {
typeName: 'Category',
create: true
},
series: {
typeName: 'Series',
create: true
}
}
}
},
{
use: '@gridsome/plugin-sitemap',
options: {
cacheTime: 600000, // default
exclude: ['https://gist.github.com/*'],
config: {}
}
},
{
use: 'gridsome-plugin-flexsearch',
options: {
flexsearch: {
profile: 'balance'
},
collections: [
{
typeName: 'Post',
indexName: 'Post',
fields: ['title', 'description', 'tags', 'date', 'path']
}
],
searchFields: ['title', 'description', 'tags']
}
},
{
use: 'gridsome-plugin-gtag',
options: {
config: {
id: process.env.GRIDSOME_ANALYTICS_ID
}
}
},
{
use: '@microflash/gridsome-plugin-feed',
options: {
contentTypes: ['Post'],
feedOptions: {
title: `Eric McCormick's Dev Blog`,
description: 'software development, operations, tooling, and tech musings',
copyright: `Copyright 2014–${new Date().getFullYear()} Eric McCormick`,
image:
"https://edm00se.io/logo_600.png",
favicon: "https://edm00se.io/logo_180.png",
author: {
name: "Eric McCormick",
link: "https://edm00se.codes/"
}
},
rss: {
enabled: true,
output: '/rss.xml'
},
atom: {
enabled: true,
output: '/feed.atom'
},
json: {
enabled: true,
output: '/feed.json'
},
maxItems: 25,
htmlFields: null,
enforceTrailingSlashes: false,
filterNodes: (node) => true,
nodeToFeedItem: (node) => ({
title: node.title,
date: node.date,
content: node.content,
description: node.description
})
}
},
{
use: 'gridsome-plugin-manifest',
options: {
background_color: '#0d2538',
icon_path: './static/logo_600.png',
name: 'Dev | Blog',
short_name: 'devblog',
theme_color: '#FFFFFF',
lang: 'en',
},
}
],
transformers: {
//Add markdown support to all file-system sources
remark: {
externalLinksTarget: '_blank',
externalLinksRel: ['nofollow', 'noopener', 'noreferrer'],
anchorClassName: 'icon icon-link',
plugins: [
'@gridsome/remark-prismjs',
'remark-attr',
[
'@noxify/gridsome-plugin-remark-embed',
{
enabledProviders: ['Youtube', 'Twitter', 'Gist', 'JSFiddle', 'CodeSandbox'],
'JSFiddle': {
secureConnection: true
}
}
]
]
}
}
};