-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
117 lines (106 loc) · 2.87 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
/* eslint camelcase: "off", global-require: "off", @typescript-eslint/no-var-requires: "off" */
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
});
// It is better to fail loudly than default to deploying to prod.
const siteDomainName = process.env.DOMAIN_NAME || "localhost";
module.exports = {
siteMetadata: {
title: `FluentLabs Reader`,
description: `A reading app that combines the support of a textbook with the freedom of the internet.`,
author: `Lucas Kjaero-Zhang`,
},
plugins: [
`gatsby-plugin-typescript`,
// SEO
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-plugin-canonical-urls`,
options: {
siteUrl: `https://www.fluentlabs.io`,
stripQueryString: true,
},
},
// CSS
`gatsby-plugin-styled-components`,
// Images
`gatsby-plugin-image`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `FluentLabs Reader - A reader for the internet`,
short_name: `FluentLabs`,
start_url: `/`,
background_color: `#663399`,
theme_color: `#663399`,
display: `minimal-ui`,
icon: `src/images/gatsby-icon.png`,
},
},
// Metrics
{
resolve: `gatsby-plugin-google-analytics`,
options: {
// Dummy tracking ID for use in CI
trackingId: process.env.GOOGLE_ANALYTICS_ID || "UA-111111111-1",
// Puts tracking script in the head instead of the body
head: false,
// Setting this parameter is optional
anonymize: true,
// Setting this parameter is also optional
respectDNT: true,
},
},
// Data sources
{
resolve: `gatsby-source-filesystem`,
options: {
name: `product`,
path: `${__dirname}/src/images/product`,
},
},
{
resolve: `gatsby-plugin-page-creator`,
options: {
path: `${__dirname}/src/pages`,
},
},
{
resolve: "gatsby-source-prismic",
options: {
repositoryName: "fluentlabs",
linkResolver: () => (doc) => linkResolver(doc),
schemas: {
blog_post: require("./custom_types/blog_post.json"),
home_page: require("./custom_types/home_page.json"),
navigation: require("./custom_types/navigation.json"),
},
lang: "*",
},
},
// Performance
`gatsby-plugin-offline`,
// Deployment
{
resolve: `gatsby-plugin-s3`,
options: {
bucketName: siteDomainName,
protocol: "https",
hostname: siteDomainName,
acl: null,
},
},
// Localization
{
resolve: "gatsby-plugin-i18n",
options: {
langKeyDefault: "en-us",
prefixDefault: false,
useLangKeyLayout: false,
},
},
],
};
const linkResolver = (_doc) => "Dummy link";