-
Notifications
You must be signed in to change notification settings - Fork 1
/
gatsby-config.js
105 lines (105 loc) · 3.09 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
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.org/docs/gatsby-config/
*/
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
})
module.exports = {
siteMetadata: {
title: "Seamain",
description: "哇偶",
author: "Seamain&Jimmy",
twitterUsername: "barcadia",
facebookUsername: "barcadia",
instagramUsername: "barcadia",
linkedinUsername: "morgan-baker-development",
image: "/macbook-color.jpg",
siteUrl: "https://seamain.org",
developerName: "Morgan Baker Development",
developerUrl: "https://www.morganbaker.dev",
},
/* Your site config here */
plugins: [
{
resolve: "gatsby-source-graphql",
options: {
typeName: "graphcms",
fieldName: "graphcms",
url: "https://api-ap-northeast-1.hygraph.com/v2/cle4ane6v051f01ulfrynb3jf/master",
},
},
`gatsby-plugin-react-helmet`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-image`,
`gatsby-plugin-offline`,
`gatsby-plugin-sitemap`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Seamain's blog`,
short_name: `Seamain`,
start_url: `/`,
background_color: `#6e83ce`,
theme_color: `#3742bf`,
// Enables "Add to Homescreen" prompt and disables browser UI (including back button)
// see https://developers.google.com/web/fundamentals/web-app-manifest/#display
display: `standalone`,
icon: `src/images/icon.png`, // This path is relative to the root of the site.
},
},
{
resolve: `gatsby-plugin-feed`,
options: {
query: `
{
site {
siteMetadata {
title
description
siteUrl
}
}
}
`,
feeds: [
{
serialize: ({ query: { site, graphcms } }) => {
return graphcms.articles.reverse().map(article => {
return Object.assign({}, {
title: article.title,
description: article.title,
date: article.createdDate,
url: encodeURI(`${site.siteMetadata.siteUrl}/blog/${article.slug}`),
guid: `${site.siteMetadata.siteUrl}/blog/${article.slug}`,
custom_elements: [
{
"content:encoded": new (require("showdown")).Converter().makeHtml(article.content),
}
]
})
})
},
query: `
query feed {
graphcms {
articles(first: 13, orderBy: createdDateTime_DESC) {
title
createdDate: createdDateTime
slug
content
}
}
}
`,
output: '/rss.xml',
title: 'Seamain'
}
]
}
}
],
}