-
Notifications
You must be signed in to change notification settings - Fork 0
/
gridsome.config.js
125 lines (113 loc) · 2.69 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
class TailwindExtractor {
static extract(content) {
return content.match(/[A-Za-z0-9-_:\/]+/g) || [];
}
}
module.exports = {
siteName: 'amishDev',
siteDescription: "A site about crafting software.",
siteUrl: 'https://amishdev.com',
titleTemplate: `%s | Bleda`,
icon: 'src/favicon.png',
transformers: {
remark: {
externalLinksTarget: '_blank',
externalLinksRel: ['nofollow', 'noopener', 'noreferrer'],
plugins: [
['gridsome-plugin-remark-shiki', {
theme: 'min-light'
}]
]
}
},
plugins: [
{
use: '@gridsome/source-filesystem',
options: {
path: 'content/posts/**/*.md',
typeName: 'Post',
refs: {
tags: {
typeName: 'Tag',
create: true,
},
author: {
typeName: 'Author',
create: true,
},
},
},
},
// {
// use: '@gridsome/plugin-google-analytics',
// options: {
// id: 'UA-135446199-1',
// },
// },
{
use: '@gridsome/plugin-sitemap',
options: {
cacheTime: 600000, // default
},
},
{
use: 'gridsome-plugin-rss',
options: {
contentTypeName: 'Post',
feedOptions: {
title: 'Bleda, a Gridsome blog starter',
feed_url: 'https://amishdev.com/feed.xml',
site_url: 'https://amishdev.com',
},
feedItemOptions: node => ({
title: node.title,
description: node.description,
url: 'https://amishdev.com/' + node.slug,
author: node.author,
date: node.date,
}),
output: {
dir: './static',
name: 'feed.xml',
},
},
},
],
templates: {
Post: '/:title',
Tag: '/tag/:id',
Author: '/author/:id',
},
chainWebpack: config => {
config.module
.rule('css')
.oneOf('normal')
.use('postcss-loader')
.tap(options => {
options.plugins.unshift(...[
require('postcss-import'),
require('postcss-nested'),
require('tailwindcss'),
])
if (process.env.NODE_ENV === 'production') {
options.plugins.push(...[
require('@fullhuman/postcss-purgecss')({
content: [
'src/assets/**/*.css',
'src/**/*.vue',
'src/**/*.js'
],
extractors: [
{
extractor: TailwindExtractor,
extensions: ['css', 'vue', 'js']
}
],
whitelistPatterns: [/shiki/]
}),
])
}
return options
})
},
}