forked from graphql/graphql.github.io
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathgatsby-config.js
119 lines (118 loc) · 2.99 KB
/
gatsby-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
module.exports = {
siteMetadata: {
title: "一种为你的 API 而生的查询语言",
description:
"GraphQL 提供了 API 中数据的完整描述,提供让客户端能够准确地获取需要的数据而不包含任何冗余的能力,让 API 更加容易随着时间推移而演进,并提供强大的开发者工具。",
siteUrl: "http://graphql.cn/",
},
plugins: [
"gatsby-plugin-react-helmet",
'gatsby-plugin-anchor-links',
{
resolve: "gatsby-source-filesystem",
options: {
name: "content",
path: `${__dirname}/src/content`,
},
},
{
resolve: "gatsby-transformer-remark",
options: {
plugins: [
{
resolve: "@weknow/gatsby-remark-twitter",
options: {
debug: true
}
}
]
}
},
{
resolve: `gatsby-plugin-webfonts`,
options: {
fonts: {
google: [
{
family: `Rubik`,
variants: [`300`],
},
{
family: `Roboto Mono`,
variants: [`400`, `400i`, `600`],
},
{
family: `Roboto`,
variants: [`300`],
},
],
},
},
},
`gatsby-plugin-less`,
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: "UA-44373548-16",
},
},
{
resolve: "gatsby-plugin-feed",
options: {
query: `
{
site {
siteMetadata {
siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, allMarkdownRemark } }) =>
allMarkdownRemark.edges.map(
({
node: {
excerpt,
frontmatter: { title, date, permalink, byline },
},
}) => ({
title,
date,
url: site.siteMetadata.siteUrl + permalink,
description: excerpt,
author: byline,
})
),
query: `
{
allMarkdownRemark(
filter: {frontmatter: {layout: {eq: "blog"}}},
sort: { order: DESC, fields: [frontmatter___date] }
) {
edges {
node {
excerpt
frontmatter {
title
date
permalink
byline
}
}
}
}
}
`,
output: "/blog/rss.xml",
title: "Blog | GraphQL",
feed_url: "http://graphql.org/blog/rss.xml",
site_url: "http://graphql.org",
},
],
},
},
],
}