-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-config.ts
81 lines (77 loc) · 2.08 KB
/
gatsby-config.ts
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
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.org/docs/gatsby-config/
*/
import { GatsbyConfig } from 'gatsby';
const config: GatsbyConfig = {
siteMetadata: {
title: 'Born, growing up.',
subtitle: 'Dad, developer, nerd.',
titleTemplate: '%s · Born, growing up.',
description:
'A blog about coding and the life of a computer programmer, by William Ghelfi.',
url: 'https://code.williamghelfi.com', // No trailing slash allowed!
image: '/images/william.jpg', // Path to your image you placed in the 'static' folder
twitterUsername: '@trumbitta',
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-image`,
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
'gatsby-plugin-styled-components',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'posts',
path: `${__dirname}/src/posts`,
},
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/assets/images`,
},
},
{
resolve: 'gatsby-plugin-mdx',
options: {
plugins: [
'gatsby-remark-unwrap-images',
'gatsby-remark-images',
'gatsby-remark-prismjs',
],
gatsbyRemarkPlugins: [
'gatsby-remark-unwrap-images',
{
resolve: 'gatsby-remark-images',
options: {
maxWidth: 1200,
},
},
{
resolve: `gatsby-remark-prismjs`,
options: {},
},
],
},
},
],
};
// https://chaseonsoftware.com/netlify-gatsby-analytics/
// https://blog.oriel.io/2019/01/24/how-to-make-google-analytics-gdpr-compliant/
if (process.env.CONTEXT === 'production') {
const googleAnalyticsCfg = {
resolve: 'gatsby-plugin-google-analytics',
options: {
trackingId: 'UA-148954935-1',
anonymize: true,
respectDNT: true,
cookieExpires: 60 * 60 * 24 * 30, // 1 month
},
};
config.plugins?.push(googleAnalyticsCfg);
}
module.exports = config;