This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
gridsome.config.js
93 lines (87 loc) · 2.43 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
// 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 marked = require('marked')
// const yaml = require('js-yaml')
module.exports = {
siteUrl: 'https://blog.spencerwoo.com',
siteName: "Spencer's Blog",
siteDescription: '开发者 / 设计师 / 少数派 / 学生',
templates: {
Post: '/:year/:month/:slug',
Tag: '/tag/: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,
},
},
},
},
{
use: '@microflash/gridsome-plugin-feed',
options: {
contentTypes: ['Post'],
feedOptions: {
title: "Spencer's Blog",
description: 'Spencer Woo - 开发者 / 设计师 / 少数派 / 学生',
image: 'https://blog.spencerwoo.com/av.png',
favicon: 'https://blog.spencerwoo.com/av.png',
},
rss: {
enabled: true,
output: '/feed.xml',
},
htmlFields: ['description', 'content'],
enforceTrailingSlashes: false,
filterNodes: node => node.published,
nodeToFeedItem: node => ({
title: node.title,
date: node.date,
content: marked(node.content),
}),
},
},
{
use: '@gridsome/plugin-google-analytics',
options: {
id: 'UA-111664763-2',
},
},
],
transformers: {
//Add markdown support to all file-system sources
remark: {
useBuiltIns: true,
externalLinksTarget: '_blank',
externalLinksRel: ['nofollow', 'noopener', 'noreferrer'],
slug: true,
autolinkHeadings: true,
autolinkClassName: 'icon icon-link',
plugins: [
'@gridsome/remark-prismjs',
'gridsome-plugin-remark-container',
'gridsome-remark-katex',
'gridsome-remark-figure-caption',
],
config: {
footnotes: true,
},
// grayMatter: {
// engines: {
// yaml: s => yaml.safeLoad(s, { schema: yaml.JSON_SCHEMA }),
// },
// },
},
},
}