-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.js
172 lines (166 loc) · 6.89 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
})
module.exports = {
siteMetadata: {
title: `Debuxing`,
description: `Debuxing: The answer to your programming problems`,
author: `@escapemanuele`,
siteUrl: `https://debuxing.com`,
},
plugins: [
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `Debuxing`,
short_name: `debuxing`,
description: `The answer to your programming questions`,
lang: `en`,
start_url: `/`,
background_color: `#000`,
theme_color: `#1a9cfc`,
display: `minimal-ui`,
icon: `src/images/debuxing-icon.png`, // This path is relative to the root of the site.
},
},
{
resolve: `gatsby-plugin-google-adsense`,
options: {
publisherId: process.env.GOOGLE_ADSENSE
},
},
{
resolve: `gatsby-plugin-gdpr-cookies`,
options: {
// googleAnalytics: {
// trackingId: process.env.GOOGLE_ANALYTICS, // leave empty if you want to disable the tracker
// cookieName: 'gatsby-gdpr-google-analytics', // default
// anonymize: true // default
// },
googleTagManager: {
trackingId: process.env.GOOGLE_TAG_MANAGER, // leave empty if you want to disable the tracker
cookieName: 'gatsby-gdpr-google-tagmanager', // default
dataLayerName: 'dataLayer', // default
},
// Defines the environments where the tracking should be available - default is ["production"]
environments: ['production', 'development']
},
},
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
`gatsby-plugin-offline`,
`gatsby-plugin-styled-components`,
`gatsby-plugin-react-helmet`,
`gatsby-plugin-transition-link`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `images`,
path: `${__dirname}/src/images`,
},
},
{
resolve: "gatsby-plugin-google-tagmanager",
options: {
id: "GTM-MT5H5NL",
// Include GTM in development.
// Defaults to false meaning GTM will only be loaded in production.
includeInDevelopment: false,
// datalayer to be set before GTM is loaded
// should be an object or a function that is executed in the browser
// Defaults to null
defaultDataLayer: { platform: "gatsby" },
},
},
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
`gatsby-plugin-sitemap`,
{
resolve: "gatsby-source-wordpress",
options: {
baseUrl: process.env.GATSBY_WORDPRESS_BASE_URL,
protocol: "https",
hostingWPCOM: false,
// If useACF is true, then the source plugin will try to import the Wordpress ACF Plugin contents.
useACF: false,
// Include specific ACF Option Pages that have a set post ID
// Regardless if an ID is set, the default options route will still be retrieved
// Must be using V3 of ACF to REST to include these routes
// Example: `["option_page_1", "option_page_2"]` will include the proper ACF option
// routes with the ID option_page_1 and option_page_2
// The IDs provided to this array should correspond to the `post_id` value when defining your
// options page using the provided `acf_add_options_page` method, in your WordPress setup
// Dashes in IDs will be converted to underscores for use in GraphQL
acfOptionPageIds: [],
auth: {
// If auth.user and auth.pass are filled, then the source plugin will be allowed
// to access endpoints that are protected with .htaccess.
// If hostingWPCOM is true then you will need to communicate with wordpress.com API
// in order to do that you need to create an app (of type Web) at https://developer.wordpress.com/apps/
// then add your clientId, clientSecret, username, and password here
// Learn about environment variables: https://www.gatsbyjs.org/docs/environment-variables
// If two-factor authentication is enabled then you need to create an Application-Specific Password,
// see https://en.support.wordpress.com/security/two-step-authentication/#application-specific-passwords
wpcom_app_clientSecret: process.env.WORDPRESS_CLIENT_SECRET,
wpcom_app_clientId: "54793",
wpcom_user: "[email protected]",
wpcom_pass: process.env.WORDPRESS_PASSWORD,
// If you use "JWT Authentication for WP REST API" (https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/)
// or (https://github.com/jonathan-dejong/simple-jwt-authentication) requires jwt_base_path, path can be found in wordpress wp-api.
// plugin, you can specify user and password to obtain access token and use authenticated requests against wordpress REST API.
jwt_user: process.env.JWT_USER,
jwt_pass: process.env.JWT_PASSWORD,
jwt_base_path: "/jwt-auth/v1/token", // Default - can skip if you are using https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/
},
plugins: [
{
resolve: `gatsby-wordpress-inline-images`,
options: {
baseUrl: process.env.GATSBY_WORDPRESS_BASE_URL,
protocol: `http`,
maxWidth: 650
}
}
],
// Set cookies that should be send with requests to wordpress as key value pairs
cookies: {},
verboseOutput: false,
perPage: 100,
//searchAndReplaceContentUrls: {
//sourceUrl: "http://debuxing.tx7.fcomet.com/",
//replacementUrl: "https://localhost:8000/",
//},
concurrentRequests: 10,
// Set WP REST API routes whitelists
// and blacklists using glob patterns.
// Defaults to whitelist the routes shown
// in the example below.
// See: https://github.com/isaacs/minimatch
// Example: `["/*/*/comments", "/yoast/**"]`
// ` will either include or exclude routes ending in `comments` and
// all routes that begin with `yoast` from fetch.
// Whitelisted routes using glob patterns
includedRoutes: [
"**/categories",
"**/posts",
"**/pages",
"**/media",
"**/tags",
"**/taxonomies",
"**/users",
],
// Blacklisted routes using glob patterns
excludedRoutes: [],
// Set this to keep media sizes.
// This option is particularly useful in case you need access to
// URLs for thumbnails, or any other media detail.
// Defaults to false
keepMediaSizes: false,
// use a custom normalizer which is applied after the built-in ones.
normalizer: function({ entities }) {
return entities
},
},
},
],
}