-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-config.js
190 lines (186 loc) · 5.46 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
const path = require("path");
const generalSettings = require("./_site/settings/general.json");
module.exports = {
siteMetadata: {
title: "inkOfPixel",
origin: "https://inkofpixel.com",
siteUrl: "https://inkofpixel.com",
},
plugins: [
"gatsby-plugin-sitemap",
"gatsby-plugin-react-helmet",
{
resolve: `gatsby-plugin-manifest`,
options: {
name: "inkOfPixel",
short_name: "iop",
start_url: "/",
background_color: "#663399",
theme_color: "#663399",
display: "minimal-ui",
icon: "src/images/favicon.png", // This path is relative to the root of the site.
},
},
"gatsby-plugin-offline",
"gatsby-plugin-styled-components",
"gatsby-plugin-typescript",
{
resolve: `gatsby-plugin-netlify-cms`,
options: {
modulePath: `${__dirname}/src/cms/extension.js`,
},
},
"gatsby-transformer-sharp",
"gatsby-plugin-sharp",
{
resolve: "gatsby-source-filesystem",
options: {
path: `${__dirname}/static/assets`,
name: "assets",
},
},
{
resolve: "gatsby-source-filesystem",
options: {
path: `${__dirname}/_site/pages`,
name: "pages",
},
},
{
resolve: "gatsby-source-filesystem",
options: {
path: `${__dirname}/_site/projects`,
name: "projects",
},
},
{
resolve: "gatsby-source-filesystem",
options: {
path: `${__dirname}/_site/posts`,
name: "posts",
},
},
{
resolve: "gatsby-source-filesystem",
options: {
path: `${__dirname}/_site/settings`,
name: "home-page",
},
},
{
resolve: "gatsby-source-filesystem",
options: {
path: `${__dirname}/_site/static-pages`,
name: "static-pages",
},
},
"gatsby-transformer-json",
"gatsby-plugin-netlify-markdown-paths",
{
resolve: "gatsby-plugin-markdown-locales",
options: {
name: "projects",
defaultLocale: generalSettings.defaultLanguage,
getPath: ({ node, locale, defaultLocale, slug }) => {
const basePathByLocale = {
en: "/projects",
it: "/progetti",
};
return locale === defaultLocale
? path.join("/", basePathByLocale[locale], slug)
: path.join("/", locale, basePathByLocale[locale], slug);
},
},
},
{
resolve: "gatsby-plugin-markdown-locales",
options: {
name: "posts",
defaultLocale: generalSettings.defaultLanguage,
getPath: ({ node, locale, defaultLocale, slug }) => {
const localizedTitle = node.frontmatter.locales
.find((l) => l.language === locale)
.title.toLowerCase()
.split(" ")
.join("-");
const basePathByLocale = {
en: "/blog",
it: "/blog",
};
return locale === defaultLocale
? path.join("/", basePathByLocale[locale], localizedTitle)
: path.join("/", locale, basePathByLocale[locale], localizedTitle);
},
},
},
{
resolve: "gatsby-plugin-markdown-locales",
options: {
name: "pages",
defaultLocale: generalSettings.defaultLanguage,
getPath: ({ node, locale, defaultLocale, slug }) => {
const currentLocale = node.frontmatter.locales.find(
(loc) => loc.language === locale
);
return locale === defaultLocale
? path.join("/", currentLocale.handle || slug)
: path.join("/", locale, currentLocale.handle || slug);
},
},
},
{
resolve: "gatsby-transformer-remark",
options: {
plugins: [
"gatsby-plugin-netlify-markdown-paths",
{
resolve: "gatsby-remark-images",
options: {
// It's important to specify the maxWidth (in pixels) of
// the content container as this plugin uses this as the
// base for generating different widths of each image.
maxWidth: 2400,
linkImagesToOriginal: false,
},
},
{
resolve: "gatsby-remark-copy-linked-files",
options: {
// `ignoreFileExtensions` defaults to [`png`, `jpg`, `jpeg`, `bmp`, `tiff`]
// as we assume you'll use gatsby-remark-images to handle
// images in markdown as it automatically creates responsive
// versions of images.
//
// If you'd like to not use gatsby-remark-images and just copy your
// original images to the public directory, set
// `ignoreFileExtensions` to an empty array.
// ignoreFileExtensions: [],
},
},
],
},
},
{
resolve: "gatsby-source-iubenda",
options: {
documentIds: ["57888804"],
},
},
{
resolve: "gatsby-plugin-google-analytics",
options: {
trackingId: "UA-28251380-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,
// Avoids sending pageview hits from custom paths
exclude: ["/preview/**", "/do-not-track/me/too/"],
},
},
"gatsby-plugin-netlify",
],
pathPrefix: "/assets",
};